How do you set up TikTok Event Deduplication?
The TikTok Events API is a game-changer in online marketing. It bypasses pixel-blocking problems caused by ad-blockers and improves the reliability of your data. When you measure TikTok data on both the client side and the server side, some events may be measured twice. TikTok would like to distinguish between events coming from the TikTok Pixel and those coming from the TikTok Events API, in order to achieve purer data analysis. Therefore, TikTok has introduced a "Unique Event ID. In this article, we explain how to apply TikTok event deduplication by setting it up in Google Tag Manager.
Steps TikTok Server Side Tracking implementation
Also check out the entire TikTok Server Side Tracking Set Up.
TikTok Event Deduplication Scenarios
Scenario | Action |
---|---|
Overlap between Pixel events | Events are deduplicated that are shared through the Pixel, with the same event and event_id parameters, arriving within a 48-hour window from the first event. |
Overlap between Events API events | Events are deduplicated that are shared via the Events API, with the same event and event_id parameters, arriving within a 48-hour window from the first event. |
Overlap between Pixel and Events API events. | Events shared by both the Pixel and the Events API are merged, if they have identical event and event_id parameters arriving within 5 minutes of each other, and additional match keys and parameters are added to the first event if applicable. Then, events that are deduplicated after 5 minutes and within a time frame of 48 hours from the first event are shared by both the Pixel and Events API, if they have identical event and event_id parameters. |
TikTok Event Deduplication set up.
Set up TikTok Event Deduplication in Google Tag Manager (Client and Server Side).
Step 1: Create Variable (Web Container)
First, set up the required variable before you can proceed with configuration. In the Web Container (Client Side), go to Variables and click New. Have you already created this variable, for example when setting up Meta Event Deduplication? Then go directly to step 3.
Step 2: Set Variable (Web Container)
Click Variable Configuration and select Discover more tag types in the Community Template Gallery. Add the Unique Event ID variable to the workspace. Name the variable Event ID and save it.
Step 3: Select TikTok pixels (Web Container)
Go to Tags within the Web Container and click on the TikTok Pixel. Not set up a TikTok Pixel yet? Then check out this blog.
Step 4: Template (Web Container)
Did you use a Template for your TikTok Pixel? Then go to the Tag → De-duplication Configurations → Add the created Variable.
Step 5: Custom HTML (Web Container)
Are you using Custom HTML for your TikTok Pixel? Then add your created Variable to the code. By default, TikTok includes all pageviews as events; you don't need to add them separately like Facebook. Successful? Click Save. Make sure:
ttq.page(); → ttq.page;
Step 6: GA4 Google Tag setup (Web Container)
Are you using a Custom HTML for your TikTok Pixel? Then add the created Variable to the code. By default, TikTok includes all pageviews as events, you don't need to add them separately like Facebook. Successful? Click on Save. Change the code from ttq.page(); to ttq.page;.
Step 7: Create Variable (Server Container)
Go to your Server Container → Variables and click New.
Step 8: Set Variable (Server Container)
Give the Variable the name Event ID. Next, click Variable Configuration and select Event Data. Under Key Path, enter event_id and save the Variable.
Step 9: Select TikTok Events API (Server Container).
Go to Tags and select the TikTok Events API.
Step 10: Set up TikTok Events API (Server Container).
Within the Tag, go to De-duplication Configurations and add the created Event ID variable. Next, save the Server Container by putting it live.
TikTok Event Deduplication Testing
To check if your deduplication worked properly and how many events were duplicated, navigate to your pixel's detail page.
- The"Browser" metric shows the unique events received only through Pixel SDK.
- The"Server" metric shows the unique events received only via Events API.
- The"Server & Browser" metric shows the unique events of both Events API and Pixel SDK after deduplication. If this metric is too low, check your deduplication implementation and make sure the event_id is identical between Pixel SDK and Events API.
Outro
This was it. Your first TikTok Server Side Tracking implementation! You have now completed the entire TikTok implementation sequence, nice going! From now on, all TikTok events are measured and deduplicated both client side and server side.