Avoid duplicate events with your browser pixel
Send the same event ID from your browser pixel and from TrueEngage so Meta counts the conversion once.
If your site fires a Meta pixel event in the browser and TrueEngage sends the same event from its servers, Meta sees two events. Meta counts one when both carry the same event name and the same event ID. This page shows how to make them match.
How deduplication works
- Meta: drops a server event when a browser event with the same name and event ID arrived in the last 48 hours. The IDs must be identical strings.
- Google Ads: TrueEngage sends the event ID as the order ID. A repeated upload with the same order ID counts once.
- GA4: has no dedupe key. Send each event from one place only.
Before you start
- A Meta connection with a mapping for the event. See Send events as conversions.
- The Web SDK, so the browser and TrueEngage can share the ID.
- The pixel event name and the mapping Destination event must be the same, for example
Purchase.
Choose an event ID
Use a value your site already knows and that is unique per action, such as an order number. Prefix it so it cannot collide with another event type, for example order_A10021.
Fire both events with the same ID
- Pass the ID to
trackaseventId.trackreturns the ID it used. - Pass the same value to the pixel as
eventID.
const { eventId } = TrueEngage.track(
'Order Placed',
{ order_total: 64.9, currency: 'EUR' },
{ eventId: `order_${orderId}` },
);
fbq('track', 'Purchase', { value: 64.9, currency: 'EUR' }, { eventID: eventId });
track always stores the ID as the event property event_id, whether you supplied it or it was generated. IDs you supply are scoped to the visitor on the server, so the same value from two visitors does not collide, and long IDs that start the same stay distinct.
Make the mapping send the same ID
- Open the mapping and go to the Destination tab.
- Under Event ID, enter a Pattern. For the example above, use
{{properties.event_id}}. - Read the Preview. It must show the same string your pixel sends.
- Select Save.
Patterns can use three values:
{{event.id}}: the TrueEngage event ID{{user.external_id}}: the user's external ID{{properties.name}}: an event property, such as{{properties.order_id}}
A pattern needs at least one value in double braces. You can mix text and values, for example order_{{properties.order_id}}, if your pixel builds the same string.
If you leave the pattern empty, TrueEngage sends the event’s event_id property when it has one, which is the ID the Web SDK returns from track, so the browser and server copies already match. Events without an event_id property (from the mobile SDKs, the server API or imports) get the TrueEngage event ID, which a browser pixel does not know.
If a value is missing
When a value in the pattern is empty, TrueEngage skips that event with the reason The event ID pattern needs a property this event does not have. It never invents a random ID, because a wrong ID would double count. Fix the property in your app or change the pattern.
TrueEngage saves the resolved ID with the delivery and reuses it on every retry.
Check that it works
- Turn on test mode on the Meta connection, with a test event code.
- Trigger the action on your site.
- In Events Manager, open Test events. You should see one
Purchasefrom the browser and one from the server, and Meta reports them as a single conversion.
What happens next
Was this page helpful?