Facebook Pixel (Meta Pixel) integration for Shopware 6.7+ with E-Commerce event tracking, Meta Conversions API (CAPI), and Klaro Consent Manager support.
Live Demo: Try all OXID eShop and Shopware plugins by Markus Michalski live — no installation, no risk. demo.markus-michalski.net
Installation via the Shopware Store is recommended. After purchase, you can install the plugin directly from the backend.
Add the private Composer repository to your shop's composer.json:
{
"repositories": [
{
"type": "composer",
"url": "https://packeton.markus-michalski.net"
}
]
}
Note: Repository credentials will be provided upon license purchase. Private repositories are managed via Packeton.
composer require mmd/sw67-facebook-pixel
When prompted for authentication, enter the credentials provided with your license.
bin/console plugin:refresh
bin/console plugin:install --activate MmdFacebookPixel
bin/console cache:clear
Update to the latest version:
composer update mmd/sw67-facebook-pixel
bin/console cache:clear
Plugin configuration in Shopware Admin:
Settings > Extensions > Facebook Pixel (Meta Pixel)
| Setting | Default | Description |
|---|---|---|
| Pixel ID | (empty) | Your Facebook Pixel ID (numeric only, e.g., "166456504661214"). Find it in Meta Events Manager. |
| Enable Tracking | Off | Master switch to enable/disable all Facebook Pixel tracking |
| Require Cookie Consent | Off | Only track after user has given consent via cookie consent manager |
| Setting | Default | Description |
|---|---|---|
| Track Product Views | On | Fire ViewContent event on product detail pages |
| Track Categories | On | Fire ViewCategory custom event on category pages |
| Track Add to Cart | On | Fire AddToCart event when products are added to cart |
| Track Checkout | On | Fire InitiateCheckout event on the checkout confirmation page |
| Track Orders | On | Fire Purchase event on order completion |
| Track Gross Prices | On | Use gross prices (incl. VAT). Disable for B2B shops to use net prices. |
| Setting | Default | Description |
|---|---|---|
| Enable Conversions API | Off | Send events server-side via Meta Conversions API (CAPI) in addition to client-side pixel |
| Access Token | (empty) | Facebook API Access Token. Generate in Meta Events Manager under Settings > Conversions API. |
| Test Event Code | (empty) | Test event code from Meta Events Manager for debugging. Remove for production use. |
| Server-Side Events | (none) | Select which events to send server-side. Meta recommends at least PageView and Purchase. |
| Setting | Default | Description |
|---|---|---|
| Use Klaro Consent Manager | Off | Requires the MmdKlaroConsent plugin. Tracking scripts only load after user consent via Klaro. |
| Klaro Service Name | facebook-pixel | Technical service name for Klaro integration. Must match the service name in MmdKlaroConsent settings. |
The Meta Conversions API allows you to send events server-side directly from your server to Meta, in addition to the standard client-side pixel. This is Meta's recommended Redundant Setup for maximum data quality.
event_idevent_id| Event | Description |
|---|---|
| PageView | Every storefront page view |
| ViewContent | Product detail page visits |
| ViewCategory | Category page visits |
| AddToCart | Products added to cart |
| InitiateCheckout | Checkout confirmation page |
| Purchase | Completed orders (includes customer email + phone for matching) |
CAPI events are processed via Symfony Messenger. Make sure your message consumer is running:
bin/console messenger:consume async
For production, set up a supervisor or systemd service to keep the consumer running. See the Shopware documentation on message queue for details.
Fired on every storefront page load.
fbq('track', 'PageView');
Fired on product detail pages.
fbq('track', 'ViewContent', {
content_ids: ['SW10001'],
content_name: 'Product Name',
content_type: 'product',
value: 29.99,
currency: 'EUR'
});
Fired on category pages (custom event).
fbq('trackCustom', 'ViewCategory', {
content_name: 'Category Name',
content_type: 'product_group',
content_category: 'Category Name'
});
Fired when a product is added to cart.
fbq('track', 'AddToCart', {
content_ids: ['SW10001'],
content_name: 'Product Name',
content_type: 'product',
value: 29.99,
currency: 'EUR'
});
Fired on the checkout confirmation page.
fbq('track', 'InitiateCheckout', {
content_ids: ['SW10001', 'SW10002'],
content_type: 'product',
value: 59.98,
currency: 'EUR',
num_items: 2
});
Fired on order completion.
fbq('track', 'Purchase', {
content_ids: ['SW10001', 'SW10002'],
content_type: 'product',
value: 59.98,
currency: 'EUR',
num_items: 2
});
When "Require Cookie Consent" is enabled, the plugin checks for a fb-pixel-consent cookie. Only when this cookie is present and set to a truthy value will tracking be activated.
For the recommended approach, use the MmdKlaroConsent plugin:
facebook-pixel)When Klaro is used, the pixel script is rendered with data-name attributes so Klaro can manage loading/unloading based on user consent.
Important for CAPI: When Klaro consent is enabled, the Conversions API has its own independent consent handling. CAPI events are only sent when the corresponding client-side event type is also enabled in the plugin configuration.
| Aspect | Implementation |
|---|---|
| Cookie Consent | Optional via built-in check or Klaro integration |
| PII Hashing | SHA-256 for email, phone, IP, user-agent (CAPI only) |
| Data sent to Meta | Pixel events via client-side JavaScript + optional CAPI |
| Consent Mode | Tracking can require explicit consent before activation |
Important: Facebook Pixel sends data to Meta (Facebook). You MUST disclose this in your privacy policy and cookie consent banner. Use the Klaro integration or built-in consent check to comply with GDPR.
bin/console cache:clearbin/console messenger:consume asyncvar/log/dev.log or var/log/prod.logThis is expected behavior in the Redundant Setup. Meta automatically deduplicates events using the event_id. If you see true duplicates (same event counted twice), verify that:
Commercial License - Single installation license including:
See LICENSE file for full terms.
For questions and support:
Markus Michalski
Email: support@markus-michalski.net