Configure the Facebook Pixel
Complete reference for Facebook Pixel and Conversions API (CAPI) settings. Use both for optimal tracking accuracy.
Location: Stores → Configuration → Magmodules → Meta - Pixel & CAPI
Overview
The module supports two tracking methods:
| Method | Type | Description |
|---|---|---|
| Facebook Pixel | Client-side (browser) | JavaScript-based tracking on your website |
| Conversions API | Server-side | Direct server-to-Facebook communication |
Recommendation: Enable both for maximum accuracy. CAPI captures events that Pixel might miss due to ad blockers or browser restrictions.
Pixel Configuration
Enable
Enable Facebook Pixel tracking on your store.
Pixel ID
Your unique Facebook Pixel identifier.
Where to find it:
- Go to Facebook Events Manager
- Select your Pixel
- Copy the Pixel ID from Settings
Events
Select which events to track via Pixel:
| Event | Triggers when |
|---|---|
| PageView | Any page is viewed |
| ViewContent | Product page is viewed |
| AddToCart | Product added to cart |
| ViewCart | Cart page is viewed |
| InitiateCheckout | Checkout is started |
| AddToWishlist | Product added to wishlist |
| Search | Search is performed |
| CompleteRegistration | Customer account is created |
| Purchase | Order is completed |
Recommendation: Enable all events for complete funnel tracking.
Conversions API Configuration
Enable
Enable server-side event tracking via Conversions API.
Access Token
Your Facebook Conversions API access token (stored encrypted).
Where to find it:
- Go to Facebook Events Manager
- Select your Pixel
- Go to Settings → Conversions API
- Click "Generate Access Token"
Events
Select which events to track via CAPI:
| Event | Triggers when |
|---|---|
| ViewContent | Product page is viewed |
| AddToCart | Product added to cart |
| AddToWishlist | Product added to wishlist |
| Search | Search is performed |
| InitiateCheckout | Checkout is started |
| AddPaymentInfo | Payment method is selected |
| CompleteRegistration | Customer account is created |
| Subscribe | Newsletter subscription |
| Lead | Contact form submission |
| Purchase | Order is completed |
How Events Are Tracked
Pixel Events (Client-Side)
Events fire via JavaScript when the action occurs in the browser:
Customer action → Browser JavaScript → Facebook Pixel → Facebook
Pros: Real-time, captures client data Cons: Blocked by ad blockers, affected by browser privacy settings
CAPI Events (Server-Side)
Events are queued and sent from your server:
Customer action → Magento Observer → Processing Queue → Cron → Facebook API
Pros: Not affected by ad blockers, more reliable Cons: Slight delay (queue processed every 5 minutes)
Event Deduplication
When both Pixel and CAPI are enabled, Facebook uses event_id to deduplicate events, ensuring each action is counted only once.
Data Captured
User Data (Hashed)
The following user data is captured and SHA-256 hashed before sending:
| Data | Source |
|---|---|
| Customer account or checkout | |
| Phone | Billing address |
| First name | Customer account or billing |
| Last name | Customer account or billing |
| City | Billing address |
| State | Billing address |
| Zip code | Billing address |
| Country | Billing address |
Technical Data
| Data | Purpose |
|---|---|
| IP Address | Geo-targeting |
| User Agent | Device targeting |
| _fbp cookie | Cross-device tracking |
| External ID | Customer ID matching |
Processing Queue
CAPI events are processed via a queue for reliability:
- Event occurs → Added to queue (status: pending)
- Cron runs every 5 minutes → Processes pending events
- Success → Status updated to "success"
- Failure → Retried up to 3 times, then marked "failed"
Monitor the queue at: Marketing → Magmodules Meta → Processing Queue
Best Practices
Enable Both Pixel and CAPI
For maximum event capture rate:
- Pixel catches immediate interactions
- CAPI provides backup for blocked/missed events
- Facebook deduplicates automatically
Select Same Events for Both
Enable the same events in both Pixel and CAPI settings to ensure complete coverage.
Monitor the Processing Queue
Regularly check the queue for failed events:
- Go to Marketing → Magmodules Meta → Processing Queue
- Filter by Status = Failed
- Check error messages
- Fix configuration issues if needed
Verify in Events Manager
After setup, verify events in Facebook:
- Go to Events Manager
- Select your Pixel
- Check "Overview" for recent events
- Use "Test Events" for real-time debugging
Need More Help?
Documentation:
- All Help Articles - Complete documentation overview
Support:
- Contact Support - Get help from our team