Handling Duplicate Pixel and Conversions API Events

For optimal ad performance, we recommend that advertisers implement the Conversions API alongside their Facebook Pixel. We call this a "redundant setup" and detail more about this recommended approach here.

When advertisers use a redundant setup, they must set up a deduplication method to ensure that the ad delivery system is able to differentiate between distinct and overlapping events. This document describes multiple deduplication method options to help Facebook deduplicate your events.

Advertisers who do not send the same event twice via both the Conversions API and Facebook Pixel do not need to set up deduplication for those events.

Event Deduplication Options

Facebook tries to deduplicate identical events sent through 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, the event_id parameter is added to your events from both the Conversions API and the browser pixel. The event_id parameter is an identifier that can uniquely distinguish between similar events. Read more about the event_id parameter.

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 15 seconds of each other), we favor the browser event.

Note that the eventID parameter for the pixel is the 4th argument in the fbq track call.

Example

fbq('track', 'Purchase', {value: 12, currency: 'USD'}, {eventID: 'EVENT_ID'});

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 to remove duplicate events automatically. This is how the process works:

  1. 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 gotten 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. Server events will not be discarded if a browser event has not been received in the past 48 hours, even if an identical browser event arrives after the server event.
  • Does not deduplicate events when only using one event source, that is browser-only or server-only. 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.

Setting Up Deduplication on the Browser Pixel

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

  • The eventID inside the optional eventData parameter should be a unique value. Depending on your Facebook Pixel implementation, you can use:
    • track to send the event for all pixels on the page
      fbq('track', 'Purchase', {value: 12, currency: 'USD'}, {eventID: 'EVENT_ID'});
    • trackSingle to send the event for one pixel
      fbq('trackSingle', 'SPECIFIC_PIXEL_ID', 'Purchase', {value: 12, currency: 'USD'}, {eventID: 'EVENT_ID'});
    • An image pixel tag with the eid parameter
      <img src="https://www.facebook.com/tr?id=PIXEL_ID&ev=Purchase&eid=EVENT_ID"/>
    If the event you are sharing does not contain parameters such as value and currency, you can set it up as follows:
    fbq('track', 'Lead', {}, {eventID: 'EVENT_ID'});
  • The eventID from the Facebook Pixel must match the event_id in the corresponding event coming from the Conversions API.
  • If we find the same server key combination (event_id and event_name) and browser key combination (eventID and 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.

Verifying Your Deduplication Setup

Learn how to verify your deduplication and event merging setup in the Verifying Your Setup documentation.