Meta Pixel and Conversions API deduplication: which event ID to use

Checked against Google, Meta and TikTok documentation on

In one line: Meta treats a browser event and a server event as the same event when the event name and the ID match: the pixel's eventID must equal the Conversions API event_id, and both must go to the same pixel. Meta discards the later copy if it arrives within 48 hours of the first. Leave the ID off either side and you are left with a weaker fallback.

Diagram: the browser pixel and the Conversions API both send Purchase with event ID 8841, and Meta counts one purchase.

The wrong pair and the right pair

The mistake that causes most double purchases is two IDs for one action. The browser sends none, or the server makes up its own.

// Browser: no event ID
fbq('track', 'Purchase', { value: 59.98, currency: 'USD' });

// Server: a random ID generated on the server
{ "event_name": "Purchase", "event_id": "b7c1e2f0-4a52-4c1d-9e3a" }

Meta cannot tell these are the same purchase, so both count. This is the fix:

// Browser
fbq('track', 'Purchase',
  { value: 59.98, currency: 'USD' },
  { eventID: 'order-8841' });

// Server
{ "event_name": "Purchase", "event_id": "order-8841" }

Meta's documentation adds two conditions: the pixel event has to match the server event_name, and both events must be sent to the same pixel ID.

Choosing the ID

For a purchase, use the order number. Both your page and your server already know it, and it is unique per order. For events with no natural ID, such as AddToCart, create a UUID in the browser at the moment of the event and pass it to your server with the request. Generating one ID in the browser and another on the server is the classic way to break this.

What it looks like on the wire

Meta's documentation shows the image-pixel form of the request:

https://www.facebook.com/tr?id=PIXEL_ID&ev=Purchase&eid=EVENT_ID

The eid parameter is the event ID. Alioramus reads it and shows it as the event ID on each Meta hit, and raises a warning, Conversion event without eventID, when a conversion event goes out without one.

Reading the deduplication tab

Events Manager has an Event Deduplication tab that reports the share of events deduplicated for each source. A low rate on a source usually means that side has no ID or a different one, so check the browser half in a debugger and the server half with Test Events. Meta's testing documentation describes sending server events with a test event code so you can see them arrive.

The fallback, and why not to rely on it

Meta documents a fallback that matches event_name with fbp and/or external_id, used consistently on browser and server events. It only works for a browser event followed by a server event; it does not deduplicate a browser-only or server-only stream. Use it as a backup for events that lack an ID, and send the ID anyway.

If an app or plugin sends server events for you, find out what ID it uses before adding your own. Two server integrations at once is a common cause of double counting. For the TikTok version of this rule, see event_id on TikTok.

Questions people ask

Do I need an event ID if I only use the Meta pixel?

No. It matters only for events you send from both the browser and the server.

How long does Meta look for a matching event?

Meta says it discards a later event with the same key received within 48 hours of the first.

Which ID do I use for Purchase?

The order number.

The Event Deduplication tab shows a low rate. Where do I look first?

At the source with the low rate. Confirm its events carry an ID and that the ID matches the other source for the same action. Check the event names for exact matches too.

Keep reading

Sources