Backed by Every Friday

Set up the Meta Pixel and Conversions API

Short answer

Put the Meta Pixel base code in the head of every page, fire standard events such as Purchase and Lead, then send the same events from your server through the Conversions API. Give each event the same event name and event ID in both places so Meta counts it once.

Why both, not one

The Pixel runs in the visitor's browser. The Conversions API sends events from your server straight to Meta. Meta says server events are processed like Pixel events and can be used for measurement, reporting and optimization in the same way.[3] Its recommendation is a redundant setup: the Conversions API alongside the Pixel, for the best ad performance.[4] When the browser misses a purchase, the server event still arrives; when both arrive, deduplication keeps one.

Step 1: install the Pixel base code

  1. Create a Pixel in Events Manager, or find your existing Pixel ID there.[1]
  2. Paste the base code between the opening and closing head tags on every page, ideally in your site-wide header. Meta says this reduces the chance of browsers or third-party code blocking it.[1]
  3. Leave the default fbq('track', 'PageView') call in place.[1]
  4. Install it on a separate mobile site too, if you have one. Tag managers work, though Meta recommends direct installation.[1]

Shopify, WooCommerce and most site builders have a Meta integration that installs the base code for you. Use it rather than pasting code by hand, and don't do both.

Step 2: add standard events

Meta has 17 standard events, including ViewContent, AddToCart, InitiateCheckout, AddPaymentInfo, Purchase, Lead, CompleteRegistration, Contact, Schedule, StartTrial and Subscribe.[2] Use the standard names wherever one fits, because campaigns can optimize toward them directly. Purchase requires a value and a currency.[2]

fbq('track', 'Purchase', {value: 49.00, currency: 'USD'}, {eventID: 'order_10482'});

The fourth argument, eventID, is what makes deduplication work in step 4.[4] Use something unique and stable, like the order ID.

Step 3: send the same events through the Conversions API

If you already have a Pixel, Meta says you can set up the Conversions API for website events in one click from Events Manager.[3] Ecommerce platforms and server-side tag managers also offer it. For a custom build, Meta's best practices ask for:

  • action_source, event_source_url and client_user_agent on website events, plus event_id and external_id on every event.[5]
  • Matching details such as email, phone, name and client IP address, hashed before sending if you don't use Meta's Business SDK.[5]
  • The fbp and fbc browser IDs, refreshed regularly.[5]
  • Events sent as they happen, in real time or close to it.[5]

Step 4: deduplicate

Meta's recommended method matches on two fields: the Pixel's eventID must equal the server event's event_id, and the Pixel's event name must equal event_name. Events with the same ID and name that arrive within 48 hours of the first are discarded as duplicates.[4]

A fallback method uses event_name plus fbp or external_id, but it only works when the browser event arrives first.[4] If you can pass an order ID to both sides, use the event ID method.

Step 5: verify

  • Load a page and look for the new PageView in Events Manager. If it isn't there, wait a few minutes and refresh.[1]
  • Send server test events with the Test Events tool, using your own details so they match.[5]
  • Check Event Match Quality, scored out of 10, for your key events. Only matched events count toward attribution and delivery.[5]
  • Place a real test order and confirm one Purchase shows, not two, with the right value.

Where RunAds fits

RunAds is an AI agent for paid ads, and it asks you to connect the Facebook profile that is an admin on your ad account, page and pixel before it builds a Meta campaign. Meta support is in early access: Mission Control builds the Facebook and Instagram campaign from your site, writes the ads, and you approve it before anything spends. You can also create it paused and turn it on yourself in Meta.

Create your free account

Credit packs from $25, 5 credits per $1 of ad spend.

Common questions

Do I need both the Meta Pixel and the Conversions API?

Meta recommends both. Its developer docs say that for best ad performance advertisers should implement the Conversions API alongside the Pixel, sending the same events from each and deduplicating them.

How does Meta deduplicate Pixel and Conversions API events?

When the Pixel's eventID matches the server event's event_id and the event names match, Meta treats them as one event. Deduplication applies to events that arrive within 48 hours of the first one with that ID.

What does a Purchase event need?

Meta's Pixel reference lists value and currency as required for Purchase, for example fbq('track', 'Purchase', {value: 49.00, currency: 'USD'}).

What is Event Match Quality?

A score out of 10 in Events Manager showing how well your server events' customer information can be matched to people on Meta. Sending more hashed customer details, such as email and phone, can raise it. Only matched events are used for attribution and delivery.

How do I check the Pixel is working?

Load a page with the Pixel, then look for a new PageView in Events Manager; Meta says to wait a few minutes and refresh if it doesn't appear. For server events, use the Test Events tool in Events Manager.

Sources

  1. Get started with the Meta Pixel, Meta for Developers. Checked Nov 9, 2026.
  2. Meta Pixel reference: standard events, Meta for Developers. Checked Nov 9, 2026.
  3. Conversions API, Meta for Developers. Checked Nov 9, 2026.
  4. Handling Duplicate Pixel and Conversions API Events, Meta for Developers. Checked Nov 9, 2026.
  5. Conversions API best practices, Meta for Developers. Checked Nov 9, 2026.

Every outside number on this page links to its source above, with the date we checked it.

Related pages

One agent for Google and Meta.

RunAds builds and watches your Google Ads campaigns, and Meta campaigns for Facebook and Instagram are in early access. 1,500+ businesses have signed up.

Create your free account Credit packs from $25, 5 credits per $1 of ad spend. No contracts.