Meta Pixel
What is the Meta Pixel?
The Meta Pixel is a tracking snippet that a storefront loads in the browser to report visitor actions to an advertising platform. It was previously known as the Facebook Pixel. Standard events cover page views, product views, add to cart, checkout start, and purchase, each with parameters such as product identifier, value, and currency. The reported data feeds three functions: measuring which campaigns led to orders, optimising delivery towards people likely to convert, and building audiences for retargeting and lookalike targeting.
Definition
Browser side collection is increasingly incomplete because tracking prevention, ad blockers, and cookie lifetimes cut signal. The Conversions API is the server-side counterpart: the shop backend sends the same events directly from its own systems, and a shared event identifier lets the platform deduplicate an event reported through both paths. Advanced matching submits hashed contact details to improve attribution. In the European Union storing identifiers on a device and processing personal data for advertising requires prior consent under the ePrivacy rules and a lawful basis under the GDPR, which supervisory authorities have examined closely, including in relation to international data transfers.
Why it matters
In a composable storefront the pixel should not be pasted into a template. Loading belongs behind a consent gate, so the snippet is injected only after a valid signal from the consent management platform, and a tag manager or a first-party event layer decouples marketing changes from frontend releases. Because a headless storefront renders routes on the client, page view events have to be bound to router transitions rather than to full page loads. Server-side events are emitted by the backend that owns the order, which keeps purchase data accurate, and the event identifier must be generated once and shared by both paths to avoid double counting.
Use cases
Category and product pages report content views that feed dynamic product ads from a catalogue feed. The cart reports add to cart and checkout start, which are the usual optimisation events for campaigns with too few purchases for stable learning. The order confirmation reports the purchase with value, currency, and line items, ideally from the server so that ad blocking does not distort revenue. Audience building uses viewed or abandoned products for retargeting windows. Consent state determines whether any of this runs, so the measurement plan needs a defined fallback for visitors who decline.
Related
Explore Consent Mode · Attribution Modeling.