Server Side Tracking

How to Fix Meta Pixel + CAPI Double Counting with event_id Deduplication

“Meta says we got 212 purchases yesterday. Shopify says 109.” That is the message that usually starts this kind of project. When numbers almost double the day after Conversions API goes live, it is nearly always the same thing: deduplication is broken.

How Meta decides two events are the same

When you send an event from the browser (Pixel) and from the server (CAPI), Meta needs a way to know they are one action. It matches them using two things:

  • the event name (for example Purchase)
  • the event ID (event_id)

If both match, Meta keeps one and drops the other. If the event ID is missing or different, Meta counts both. That is your double counting.

Step by step setup in GTM

  1. Add a unique ID variable in web GTM. Stape offers a free Unique Event ID variable template in the Template Gallery. It creates an ID from a timestamp plus a random number.
  2. Add it to every Meta Pixel tag. In each Pixel tag, set the Event ID field to that variable.
  3. Send the same ID to the server. If you use the GA4 tag to send data to sGTM, add an event_id parameter in the Google tag settings. If you use Stape’s Data Tag, add event_id to every Data Tag.
  4. Read it in the server container. Create an Event Data variable with key path event_id.
  5. Map it in the Meta CAPI tag. Put that variable in the Event ID field of the Facebook Conversions API tag.
  6. Test. Open Events Manager → Test Events. Fire a test event and confirm you see both Browser and Server, marked as deduplicated.

Mistakes that break it

  • A second pixel outside GTM. A Shopify app, a WordPress plugin or a hardcoded snippet keeps firing browser events with no event ID. Those can never be matched. Find and remove every extra source.
  • Tag sequencing creating new IDs. If tags fire in a sequence, each one can generate its own ID. Make sure the ID is created once per event and reused.
  • Different event names. Purchase in the Pixel and purchase in CAPI are not the same event to Meta. Check spelling and case.
  • Only checking one event. People test PageView, see it working, and stop. Test Purchase, Lead and AddToCart too.

What I usually find on audits

The classic case: browser events carry an event ID only some of the time, while server events always do. On paper “dedup is set up”, but in Events Manager the dedup rate is close to zero. The fix is rarely in the CAPI tag. It is almost always cleaning up extra browser sources so every Pixel event comes from GTM with the shared ID.

A quick health check

Where to lookHealthyProblem
Events Manager → event → DetailsBoth Browser and Server listed, deduplication shownOnly one source, or no dedup info
Purchase count vs your shopWithin a small gapNear double
Test EventsSame event_id on both rowsIDs differ or one is empty

Bottom line

CAPI without deduplication makes your reports worse, not better. Spend the extra 20 minutes on the event ID before you tell the client the setup is live.

Source reading: Stape — deduplication config, Stape Unique Event ID variable on GitHub

Leave a Reply

Your email address will not be published. Required fields are marked *