Facebook Pixel: Configuration
Facebook Pixel plugin for Sylius: settings per channel, Conversions API setup, fail-closed consent requirement and practical examples.
Facebook Pixel: Configuration
Live Demo: Try this and other plugins live — no installation, no risk: demo.markus-michalski.net
Settings per channel
In the admin under MMKreativ Plugins > Facebook Pixel there is one row per Sylius channel. The overview shows channel, Pixel ID, Tracking enabled and Conversions API enabled. A channel without a row, or with Tracking enabled switched off, behaves exactly as if the plugin were not installed.
| Setting | Default | Description |
|---|---|---|
| Channel | - | The Sylius channel this row applies to; only one row per channel is possible. |
| Tracking enabled | Off | Master switch. The browser pixel and CAPI stay off while it is unchecked, regardless of all settings below. |
| Pixel ID | empty | Numeric Meta Pixel ID from Meta Events Manager. Digits only are accepted; without a valid Pixel ID nothing is rendered and nothing is sent, even with Tracking enabled set. |
| Track gross prices | On | Whether AddToCart, InitiateCheckout and Purchase report the gross or the net value (line or order total with or without tax). Does not apply to ViewContent. |
| Track PageView | On | Fires on every storefront page. |
| Track ViewContent | On | Product detail page. |
| Track ViewCategory | On | Category listing page (sent as a Meta custom event, fbq('trackCustom', ...)). |
| Track AddToCart | On | Fires on the actual add-to-cart action, not on every reload of the cart page. |
| Track InitiateCheckout | On | First checkout step (address). |
| Track Purchase | On | Order confirmation page. |
| Release the tracking scripts through Klaro consent | On | See Storefront Integration. Only effective while mmd/sylius-klaro-consent-plugin is installed; otherwise the field is disabled and shown unticked. |
| Conversions API enabled | Off | Server-side copy of the events, see below. |
| Require verified consent for server-side events | On | Fail closed by default, see below. |
| Conversions API access token | empty | Write-only: the stored token is never shown again; leaving it blank keeps the current token. |
| Remove the stored access token | Off | Ticking it deletes the token, regardless of what is in the token field. |
| Test event code | empty | From Meta Events Manager under Test Events, while testing only. Leave empty in production. |
| Events sent via Conversions API | none selected | Which of the tracked events are also sent server-side. All six events are available. |
Conversions API (server-side)
An event is sent to Meta via CAPI when all of these conditions are met:
- Tracking enabled is on and the Pixel ID is valid.
- Tracking for this event is ticked (for example Track Purchase). The CAPI copy is created at the same place as the browser event; if the event is switched off, there is no server-side copy either.
- Conversions API enabled is on and an access token is stored.
- The event is selected under Events sent via Conversions API. By default none is selected, so a freshly created channel sends nothing via CAPI.
- The consent check allows it (see below).
Sending is asynchronous through Symfony Messenger (the main transport), so a slow or failing call to Meta never blocks the storefront request or the add-to-cart action. Send failures are only logged; there is no retry.
Require verified consent for server-side events (on by default, also for existing rows) decides whether CAPI may send at all: when the option is on, at least one consent-evidence provider must confirm the current visitor's consent, otherwise nothing is sent (fail closed). If you switch the option off, this check is skipped completely: events then go to Meta without any consent evidence, and you are responsible for having obtained consent some other way. The built-in Klaro provider and custom providers: see Extending.
Which data is transmitted is described on the Privacy page.
Practical examples
B2C shop with Klaro, CAPI for Purchase only
- Tracking enabled: on, Pixel ID: your own numeric ID
- Release the tracking scripts through Klaro consent: on (default)
- Conversions API enabled: on, access token entered, Events sent via Conversions API:
Purchase - Require verified consent for server-side events: on (default). CAPI then only sends for visitors whose Klaro cookie agrees to
facebook_pixel.
B2B shop without Klaro, net prices, no CAPI
- Tracking enabled: on, Pixel ID: your own numeric ID
- Track gross prices: off
- Release the tracking scripts through Klaro consent: disabled (Klaro plugin not installed). Another consent tool in the shop must block the pixel script itself until consent is given.
- Conversions API enabled: off