Contact salesTry for free

How to set up Facebook event deduplication in Google Tag Manager

Ivanna Holubovska

Ivanna Holubovska

Author
Updated
Nov 10, 2021
Also available in

Using Facebook server-side tracking (Facebook Conversions API) is getting more popular due to its ability to prevent tracking pixel blocking by ITPs and AdBlockers. Another massive benefit of Facebook conversion API is that it increases FB cookie lifetime. If you haven’t yet implemented FB Conversions API on your site, follow this guide. 

In this article, I will describe how to set up Facebook events deduplication if you are using both browser and server tracking methods for your site.

Why do you need to set up Facebook event deduplication?

The Facebook pixel and Conversions API lets you share standard and custom events with FB so that you can measure and optimize ad performance. The pixel enables you to share web events from a web browser, while the Conversions API lets you share web events directly from the cloud server. 

Both Facebook pixel and Facebook conversion API let you send events. The difference is that pixel sends events from the browser, and CAPI sends events from the server. If you tell Facebook that the browser and server method send identical events, they will accept one and discard another.

There are several ways of setting up Facebook tracking, including the following:

  1. Using solely browser (pixel) method. It is not recommended by FB because of user tracking restrictions.
  2. Using only server tracking. The main benefit of having tracking only on the server is that FB pixel will not overload your website. Your site will load faster, and it will lead to a better user experience.
  3. Combine browser and server tracking. Here you have several options:
  • Send some events from the browser and another from server. For example, Shopify native FB Conversion API integration will send all FB events through the browser and purchase events from the Server. In this case, you do not need the deduplication.
  • Send all events from the browser and server.


If you decide to use both browser and server events tracking for all your events, in this case, you will need to set up event deduplication. With Facebook event deduplication, FB will receive all your events, understand that events are identical, clean some of them, and keep others. If you combine the browser and server method but do not set up event deduplication, your data will not be correct because all the events will be tracked twice.

Facebook requires sending two event parameters for event deduplication: its event name and event ID. You already sending the event name with the existing setup. This article will cover how to configure Facebook event ID inside the Google Tag Manager container.

How does Facebook event deduplication work?

Facebook has two way of identifying duplicated events that were sent from browser and server:

1. Event ID and event name. 

Facebook recommends this method, and we will cover it in our how-to. For this method, you must use event ID for all events you send via pixel and CAPI. FB will deduplicate Facebook Pixels and Conversion API events with identical event names and event IDs. Facebook gives more credit to the browser event, and if they see similar events and come within 5 minutes difference, they will keep browser events and clean server events. 

2. FBP or External ID

This method exists but is not recommended by Facebook. In this case, you will need to send the event name, fbp, and/or external_id for all your browser and server events. Facebook compares all these parameters and identifies if they already have a browser event with these parameters, and if they do, they discard server events. FB does not recommend using these events since they can identify deduplication only if the browser event was sent first. It means that if you send a server event first, events will be duplicated. 

Facebook also can merge events. For example, if you send some enriched data from the server, you can add the missing data to the browser event. That is not a default feature. To enable it, you should contact a Facebook representative.

author

Ivanna Holubovska

Author

Content contributor at Stape.io, focusing on server-side tracking, digital marketing, and innovative solutions to optimize online business performance. optimize online business performance.

Comments

Try Stape for all things server-side

What’s going on?

Where are we going?

Attention!
This is a stand-up dog zone.