First, the required variable must be set up before beginning further configuration. Within the web container (client side), go to "Variables" and click on "New."
Click on "Variable configuration" and then choose "Discover more variable types in the template gallery....". Here, search for unique event id and add the "Unique Event ID" variable to the workspace. Then save the variable.
Go to "Tags" within the web container and click on the Facebook Pixel.
In this guide, we are using a template. Due to the transition from UA to GA4, it is necessary to create multiple tags from this template. One per event you want to measure. Do you also have multiple tags from the Facebook Pixel? Then add the event_id to each tag as described below.
Click on the pencil and go to "More settings". Here, click on the + sign and select the Unique Event ID variable you just created. Then save the tag by clicking "Save".
Are you using a custom HTML script or multiple HTML scripts per event? Then you need to add an event ID parameter to the Facebook event you want to measure. Add the following code after the event you want to track:fbq('track', 'EVENTNAME', {},{eventID: '{{Facebook event ID}}'});
Example change in code PageView:fbq('track', 'PageView'); -> fbq('track', 'PageView', {},{eventID: '{{Facebook event ID}}'});
Then click on "Save".
Go to "Tags" → "Google Tag". Then under "Configuration parameter", add the following parameter: event_id - {{Unique Event ID}}
. Then save the tag and Facebook is deduplicated on the Client Side.
Then repeat this for all GA4 Event Tags. When all tags are set press "Submit" at the top right to put the container live
Now that the event deduplication client-side is set up we will now set it up server side. Go to the server container and click on "Variables". Then click on "New".
Click on the pencil icon. Then click on "event data" and select it. Next, under key path, enter event_id. Give the variable a name, for example: Facebook Event ID. Then save the variable. Don't see event data? Then you're probably working in the client-side container instead of the server container.
Within the server container, go to "Tags" and select the "Facebook Conversion API".
Need to configure the Facebook CAPI? Go to the dedicated guide.
Click on the pencil and go to "server event data to override". Then click on "add property".
At "Property Name", select "Event ID". At "Property Value", click on the plus sign and select "Facebook Event ID". Click "Save" to save the tag.
All you have to do now is to put the server container live, and then you will have completed the entire Meta implementation sequence. From now on, all Meta events will be measured and deduplicated both client side and server side.
You can validate Facebook Event Deduplication in Facebook's Business Manager. Go to your Pixel --> Select Event --> View Details. Here you can see how much % of the event is deduplicated.
We have added the Event ID, so we look at Event ID in Deduplication Keys. We see that from the Facebook Pixel 95.35% is deduplicated and from the Conversion API 100%.