Deduplicate Pixel and Server Events

If you are already sending events via Facebook pixel, there are different ways to add server events, which are sent through the Conversions API. For example:

ImplementationExampleDeduplication Considerations

Send different types of events via browser and server.

This can be used if you want to separate events completed on the person's browser from events completed outside the browser. In this case, you can send Purchase events via browser, and AddToCart events via server.

If you choose this option, you do not need to worry about event deduplication.

Send all of your events via both browser and server.

This can be used if you do not want to miss any events coming from the browser. For example, send all Purchase and AddToCart events via both browser and server.

You need to set up a deduplication process. See Event Deduplication Options.

Event Deduplication Options

Facebook tries to deduplicate identical events sent through the Facebook pixel and the Conversions API. We have two ways of deduplicating your events:

Event ID and Event Name - Recommended

Required Parameters

For this approach, event ID must be used across browser and server events. Preferably, you should also add the event name parameter to your events.

Approach Description

We determine if events are identical based on their ID and name. So, for an event to be deduplicated:

  1. In corresponding events, a Facebook pixel's eventID must match the conversion API's event_id.
  2. In corresponding events, a Facebook pixel's event must match the conversion API's event_name.

Once your event fulfills both conditions, we keep the first one and remove the following one. If a server and browser event arrive at approximately the same time (within 5 minutes of each other), we favor the browser event.

FBP or External ID

Required Parameters

For this approach, you must use event name, fbp and/or external_id consistently across browser and server events.

Approach Description

If you have configured the external_id and/or fbp parameters to be passed via both browser and server, we take care of removing duplicate events automatically. This is how the process works:

  1. First, you send us a browser event with event name and fbp and/or external_id.
  2. Then, you send us a server event with event name and fbp and/or external_id.
  3. We compare the server event with the previously sent browser event. Specifically, we compare the event name and fbp and/or external_id combinations.
  4. If we see that we already got that event from the browser, we discard the server event.

Approach Limitations

This deduplication method:

  • Always discards the server event.
  • Only works for deduplicating events sent first from the browser and then through the server. If you send us two consecutive browser events with the same information, we do not discard either. If you send us two consecutive server events with the same information, we do not discard either.

Deduplication Best Practices

For better matching, we need accurate information from your events coming through both pixel and the Conversions API:

  • The eventID inside the optional eventData parameter should be a unique value. Depending on your pixel implementation, you can use:
    • track: send the event for all pixels on the page,
    • trackSingle: send the event for one pixel,
    • an image pixel tag with the eid parameter.
fbq('track', 'Purchase', {value: 12, currency: 'USD'}, {eventID: 'EVENT_ID'});
fbq('trackSingle', 'SPECIFIC_PIXEL_ID', 'Purchase', {value: 12, currency: 'USD'}, {eventID: 'EVENT_ID'});
<img src="https://www.facebook.com/tr?id=PIXEL_ID&ev=Purchase&eid=EVENT_ID"/>
  • The eventID from the Facebook pixel must match the event_id in the corresponding event coming from the conversion API.

  • If we find the same server key combination (event_id, event_name) and browser key combination (eventID, event) sent to the same pixel ID within 48 hours, we discard the subsequent events.

  • If you are sending us your events via both browser and the Conversions API along with matching event_ids, keep in mind that events are only deduplicated if they are received within 48 hours of when we receive the first event with a given event_id.

Event Merging

If you are sending events via browser and server, you must first set up the deduplication process described above. Once you have that in place, you may be eligible for an additional feature: merging events.

Event merger leverages event_id and event_name to combine browser and server events, as long as they have arrived within 10 minutes of each other. Events that arrive more than 10 minutes after each other are not merged.

Event merger can get better value for a select set of advertisers. To enable this feature, contact your Facebook representative.