Open Tracked/Integrations/How to set up Facebook event deduplication in Google tag manager

How to set up Facebook event deduplication in Google tag manager

Create one event ID, give it to the browser pixel tag and to the server tag, and check "Deduplicated" in Events Manager.

5 min read · Updated October 26, 2026

DData layer event_idPPixel tag and server tagMeta counts once
In this guide
Key takeaways
  • Push an event_id into the data layer with the event.
  • In the web container, put it in the Meta pixel tag as the event ID. In the server container, read it from the event data and send it as event_id.
  • Use the same event name on both sides, then confirm in Test Events.

This is the click-by-click version of server-side tracking event deduplication, for Meta only. It assumes you already have a Meta pixel tag in the web container and a Meta Conversions API tag in the server container. If not, start with how to set up the Facebook Conversions API.

Step 1: create the ID in the data layer

When the event happens, push it with an ID. For a purchase use the order number:

dataLayer.push({
  event: "purchase",
  event_id: "ord_10293",
  ecommerce: { transaction_id: "10293", value: 59.9, currency: "USD", items: [] }
});

For events without a natural ID, create a random one, for example from a timestamp and a random number, once per event.

Data in, clean out

Raw events in. Clean events out.

Open Tracked collects each event on your own domain, removes the noise and sends what is left to Meta, Google Ads, TikTok.

Step 2: read it in the web container

1

Create a Data Layer Variable

Name it DLV - event_id, with the data layer variable name event_id.

2

Open the Meta pixel tag

In the tag, find the field for the event ID (in the Meta template it is called Event ID).

3

Select the variable

Choose DLV - event_id.

4

Send it to your server too

In the GA4 or server tag, add event_id as a parameter so the server container receives it.

Step 3: read it in the server container

1

Open the Meta Conversions API tag

In the server container.

2

Add an Event Data variable

Create ED - event_id that reads event_id from the event data.

3

Set the tag's event ID

Choose ED - event_id in the tag's event ID field.

4

Match the event name

Make sure the tag sends Purchase when the pixel sends Purchase.

The short version

3 things to remember

Scroll and the points stack up.

01

Push an event_id into the data layer with the event.

02

In the web container, put it in the Meta pixel tag as the event ID. In the server container, read it from the event data and send

03

Use the same event name on both sides, then confirm in Test Events.

Step 4: test

  1. Open Meta Events Manager, then Test Events, and use your test code.
  2. Place a test order.
  3. You should see two lines for the purchase, from Browser and Server, each with the same Event ID.
  4. Open the details: Meta marks one as deduplicated.
  5. Remove the test event code from the server tag before you go live.

When Meta still counts twice

SymptomDifferent IDs
Likely causeThe browser generates one value and the server another.
FixCreate the ID once in the data layer and use it in both places.
SymptomDifferent event names
Likely causepurchase against Purchase, or a custom name.
FixUse the same standard event name.
SymptomServer event sent hours later
Likely causeIt missed the window or came first.
FixSend it promptly. Meta dedupes within about 48 hours.
SymptomThe ID is empty on some events
Likely causeThe data layer value is missing for that event.
FixCheck the variable in Preview for each event type.
0 of 6 done

Where this fits in the bigger set-up

Deduplication is one part of a working Conversions API set-up. The others are matching data (see event match quality), cookies that survive Safari (see Safari ITP) and consent (see Consent Mode v2). If purchases are doubled, fix the event ID first, because every other measurement depends on counting each order once. A week of clean data after the fix will tell you whether the other parts need work. Keep a note of where the event ID is created and which tags read it, so the next person who edits the checkout does not break the link by accident.

Terms you will see

Data layer
A list on the page where you push values for Tag Manager to read.
Data Layer Variable
A Tag Manager variable that reads one value from the data layer.
Event data
The parameters of an event inside a server container.
Test event code
A code that sends events to the Test Events tab only.
Deduplication
Counting the browser and server copy of an event once.

Platform-specific checks

0 of 5 done
Trusted

Brands that grow on cleaner data

Stores and agencies use Open Tracked to see which ads earn the sale.

Frequently asked questions

Where do I put the event ID in the Meta pixel tag?

In the tag's event ID field, using a variable that reads the event_id from the data layer.

Does the event name have to match?

Yes. Meta uses the event name and the event ID together.

How do I know deduplication works?

In Test Events, the event shows both sources and Meta marks the duplicate as deduplicated.

What happens if I send only from the server?

No deduplication is needed, but you lose browser signals.

How long can the two events be apart?

About 48 hours for Meta to deduplicate them.

Do I need spreadsheets to read my results?

No. Once tracking is live, the Open Tracked analytics shows spend, revenue, ROAS and profit, and you can ask Ari, the built-in AI assistant, questions about your own numbers in plain words. Ari's allowance depends on your analytics plan.

Is Open Tracked different from Open Track or Open Space Track?

No. Open Tracked is the official name of our server-side tracking platform, and the website is opentracked.io. Many people search for it as Open Track, OpenTrack or Open Space Track. All of them lead to the same product: server-side Google Tag Manager hosting, first-party analytics and a CRM pipeline.

Fix your tracking at the source

Open Tracked hosts your server-side Tag Manager, keeps first-party cookies alive and shows what each ad is really worth.

Open Tracked
Written by

The Open Tracked team

We build Open Tracked: server-side tracking hosting, analytics and the tools around them, for stores that spend on ads. Questions about this guide, or an idea for the next one?

Write to us Read the docs

Was this article helpful?

Comments

Loading comments...

Turn better tracking into better marketing performance

Start free