Meta Pixel and Conversions API: measuring Facebook and Instagram ads

The Meta Pixel (formerly Facebook Pixel) is code on your website that sends events to Meta when someone views a page, adds to cart or buys. The Conversions API (CAPI) sends the same events from your server instead of the browser.

Together they give Meta better data. On its own, the pixel loses signals to ad blockers, browser restrictions and declined consent.

Standard events

EventWhenWho needs it
PageViewEvery page viewEveryone
ViewContentProduct or service pageEcommerce, services
AddToCartItem added to cartEcommerce
PurchaseCompleted order with value and currencyEcommerce
LeadForm submittedServices and B2B

Why add the Conversions API?

CAPI sends events directly from your store, CRM or server, so they are not blocked in the browser. You can also send events that happen later, such as a lead becoming a customer. CAPI does not replace the pixel. Meta recommends running both.

Deduplication

When both browser and server send the same purchase, use a shared event ID. The pixel sends eventID, the server sends event_id with the same value, and the event name must match. Meta then discards the duplicate if it arrives within 48 hours. Without it, purchases are counted twice and ROAS looks better than it is.

Setup

  1. Create or find the dataset (pixel) in Events Manager.
  2. Install the pixel via Google Tag Manager or your platform integration (Shopify, WooCommerce).
  3. Enable CAPI via the platform integration, a partner or server-side GTM.
  4. Send the same event_id from browser and server.
  5. Send hashed customer data where consent allows, to raise Event Match Quality.
  6. Check deduplication and Event Match Quality in Events Manager.

In Norway and the EU, events should only be sent to Meta when the user has consented to marketing. A server setup is not a way around consent. See server-side tagging.

Frequently asked questions

What is the Meta Pixel?

Code on your website that sends events such as page views, add to cart and purchases to Meta, used to measure ads, build audiences and optimise campaigns.

Is Facebook Pixel the same as Meta Pixel?

Yes. It was renamed after Facebook became Meta in 2021.

Do I need the Conversions API if I have the pixel?

For most advertisers, yes. The pixel loses signals in the browser, and CAPI fills the gaps from the server.

How do I avoid double counting with pixel and CAPI?

Send the same event name and the same event ID from browser (eventID) and server (event_id). Meta discards the duplicate within 48 hours.

Read also

Sources

  1. Meta for Developers, Meta Pixel: developers.facebook.com/docs/meta-pixel
  2. Meta for Developers, Conversions API: developers.facebook.com/docs/marketing-api/conversions-api
  3. Meta for Developers, Handling Duplicate Pixel and Conversions API Events: developers.facebook.com/docs/marketing-api/conversions-api/d

More about Marius Vestlien Hansen →

Read next

More articles

All articles
Next step

Get in touch for a coffee and a chat about how I can strengthen your business

Book a coffee chat