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:
Implementation | Example | Deduplication 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 | 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 | You need to set up a deduplication process. See 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:
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.
We determine if events are identical based on their ID and name. So, for an event to be deduplicated:
eventID
must match the conversion API's event_id
.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.
For this approach, you must use event name, fbp and/or external_id consistently across browser and server events.
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:
This deduplication method:
For better matching, we need accurate information from your events coming through both Pixel and conversion API:
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,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
.
If you are sending events via browser and server, you must first setup 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.