How do you set up TikTok Event Deduplication?

TikTok-Event-Deduplication

The TikTok Events API is a game-changer in online marketing. It circumvents 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. That’s why 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.

Also check out the entire TikTok Server Side Tracking Set Up.

TikTok Event Deduplication Scenarios

ScenarioAction
Overlap between Pixels events.Events are deduplicated that are shared through the Pixel, with the same event and event_id parameters, arriving within a 48-hour time frame 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 time frame from the first event.
Overlap between Pixels and Events API events.Events shared by both the Pixel and 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 are deduplicated that are shared by both the Pixel and Events API after 5 minutes and within a 48-hour time frame from the first event, if they have identical event and event_id parameters.

TikTok Event Deduplication set up

Set up TikTok Event Deduplication in Google Tag Manager (Client-side and Server Side).

Step 1: Create Variables (Web Container)

Default-workspace-webcontainer-variables

First, we must set the necessary variable before we can begin further configuration. Within the Web Container (Client Side) , go to Variables and click New. Have you already created these because you already have Meta Event Deduplication set up, for example? Then go to step 3.

Step 2: Set Variables (Web Container).

create-unique-event-id-variable-gtm-webcontainer

Click Variable Configuration and then choose Discover more tag types in the Community Template Gallery. Add the Unique Event ID variable to the workspace here. Name the variable Event ID and save it.

Step 3: Select TikTok Pixels (Web Container).

select tiktok pixel web container gtm

Go to Tags within the Web Container and click on the TikTok Pixel. Not set up TikTok Pixel yet? Then check out this blog.

Step 4: Template (Web Container).

tiktok-event-deduplication-template-tiktok-pixel-gtm

Did you use a Template for your TikTok Pixel? Then go to the TagDe-duplication Configurations → Add your created Variable.

Step 5: Custom HTML (Web Container).

custom-html-tiktok-pixel-event-deduplication-gtm

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 have to add these separately like with Facebook. Any luck? Click Save.

Make sure ttq.page(); ttq.page;

Step 6: GA4 Google Tag setup (Web Container)

google-tag-ga4-configuration-event-deduplication

Go to Tags → Google Tag. Then, under Configuration parameter, add the following parameter: event_id – {{Event ID}}. Then Save the tag and TikTok is deduplicated to the Client Side. Then repeat this for all GA4 Event Tags. When all the tags are setup press ‘ Submit’ at the top right to put the container live.

Step 7: Create Variable (Server Container).

create-new-variable-gtm-server-container

Now go to your Server ContainerVariables and click New here.

Step 8: Set Variable (Server Container).

setup-event-id-server-container-gtm

Give the Variable the name Event ID. Next, click Variable Configuration and choose Event data here. Under Key Path, choose event_id and save the Variable.

Step 8: Select TikTok Events API (Server Container).

ga4-trigger

Go to Tags and select the TikTok Events API here.

Step 9: Set up TikTok Events API (Server Container).

adding-event-id-to-tiktok-events-api-gtm-server-container

Within the Tag, go to De-duplication Configurations and add your created Event ID variable here. Next, save the Server Container by making it live.

TikTok Event Deduplication Testing

To check if your deduplication worked properly and how many events were deduplicated, navigate to your pixel’s detail page.

  • The“Browser” metric shows the unique events received only through Pixels SDK.
  • The“Server” metric shows the unique events received only through Events API.
  • The“Server & Browser” metrics show the unique events of both Events API and Pixels 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.
validate-tiktok-event-deduplication

This was it. Your first TikTok Server Side Tracking implementation! You have now gone through the entire TikTok implementation sequence, nice going! As of now, all TikTok events are measured and deduplicated both client side and server side.

Ready for the next level?

Start with Server Side Tracking and generate more revenue and conversions in a world without third-party cookies.