Meta Pixel
Send page views, product views, carts, checkouts and purchases to your Meta pixel for Facebook and Instagram ads, after the visitor's marketing consent.
The Meta Pixel app loads Meta's pixel (fbevents.js) on the storefront and sends standard events, so your Facebook and Instagram ads can measure and optimize for sales.
Set it up
Find your pixel ID
In Meta Events Manager: Data sources, your pixel, Settings. The pixel ID (also called the dataset ID) is 10 to 20 digits.
Install and paste it
In the store: Apps, Meta Pixel, Install. Paste the ID under Pixel ID and Save. Spaces are taken out for you.
Know when it runs
The pixel needs marketing consent where your cookie banner shows. Read the step, then Mark done. Events Manager's Test events shows your visits while you browse the store with marketing cookies accepted.
What it sends
| Store event | Meta event | With |
|---|---|---|
| Any page opens | PageView | |
| A product page opens | ViewContent | content_ids, contents, content_name, value, currency |
| Add to cart | AddToCart | content_ids, contents, value, currency |
| Checkout opens | InitiateCheckout | content_ids, contents, num_items, value, currency |
| The thank-you page after an order | Purchase | content_ids, contents, num_items, value, currency |
content_type is product and ids are the store's product ids. Every event goes out with an eventID; the purchase's is purchase_ followed by the order's id, so a later server-side copy of the same purchase would count once.
A quick Add button on a product card knows only which product was added, so its AddToCart has no value. The product page's button sends the price too.
Consent
The pixel waits for marketing consent wherever the store's cookie banner applies. Nothing from Meta loads before. Taking consent back stops the events and calls fbq('consent', 'revoke'). A visitor who opted out on the store's "Do not sell or share" page has marketing off, so the pixel never loads for them. See Privacy and cookies.
Not included
Meta's Conversions API (sending events from the server with an access token) isn't part of the app yet. The event ids are already in place for it.