Meta Pixel module

Module id: meta. Dependencies: none.

The website's Meta (Facebook, Instagram) Pixel, and the same purchases sent from the server through Meta's Conversions API. Every theme gets it from the shared base layout; nothing has to change in a theme.

The module is off on every website until it is switched on in the Modules tab. Its settings are under Module settings → Meta Pixel, and can be filled in before the module is switched on.

What operators set

Setting What it does
Pixel ID The Pixel (dataset) ID from Meta Events Manager. Digits only.
Conversions API access token From Events Manager, Settings, Conversions API. Optional: without it only the browser Pixel runs.
Test event code From Events Manager, Test events. While set, server events land in the Test events tab only.

The access token is a credential: it is stored encrypted and never shown again. Leave the field empty to keep the stored one; tick Remove the stored token to delete it.

Send test event sends one PageView through the Conversions API with the test code, so it shows up under Test events and nowhere else. It refuses without a test code, so a test cannot end up in the real data.

What is sent

In the browser, with the visitor's Marketing consent only:

  • a PageView on every page;
  • a Purchase on the thank-you page, once per paid order, with the buyer's details for Meta's advanced matching.

A visitor who has not chosen yet gets the Pixel the moment they allow marketing. A visitor who chose without marketing never loads it.

From the server, once the order is paid: the same Purchase, for orders placed with marketing consent only. Without consent at the moment of ordering nothing about the order is kept for Meta and it is never sent.

Both carry the same event id, purchase.<order id>, so Meta counts the order once. The value is the order total incl. VAT and shipping, with each line's id, quantity and price.

What the server sends to match the buyer: email, phone (with country code), first and last name, city, postcode and country, all SHA-256 hashed as Meta requires, plus the browser's Meta cookies (_fbp, _fbc), IP address and user agent, taken when the order was placed.

Checking it

Each server send is written to the order's payment events: meta_capi_sent (with Meta's trace id) or meta_capi_failed (with Meta's error, never the token). A failed send is retried by the worker. An order paid more than 7 days ago is not sent: Meta refuses older events.

Going live with a client:

  1. Pixel ID, token and a test code in the settings; Send test event.
  2. A test order with the payment provider in test mode: Events Manager's Test events shows one Purchase, browser and server, deduplicated.
  3. Clear the test code, then one real order.

The client has to name Meta in their privacy and cookie statement.

Not sent

ViewContent, AddToCart and InitiateCheckout. bol.com orders (they never go through the shop's checkout). Refunds and cancellations: Meta has no negative purchase, so its revenue is gross.

Editor previews

The page editor and the designer preview never load the Pixel.