Logo of TAGGRS, written in blue and with a small favicon
HomeServer-side Tracking
Start for free
Introduction
Get started
Get started with TAGGRSSet up Google Tag ManagerAdd the GTM Data LayerConfigure GTM transformationsTest the setupDebuggingAnalytics dashboard
Migrate from Google CloudMigrate from hosting
Shortcuts
GTM Copy PasteReady-made templates
GA4 Server-side Tracking
Setup in GTMCreate GA4 Event TagsGA4 tag setup in server containerE-commerce events in GTM
Google Ads Server-side Tracking
Install Conversion LinkerSet up Conversion TrackingConfigure Enhanced ConversionsDeploy Remarketing Tags
Facebook Server-side Tracking
Set Meta PixelImprove your EMQ ScoreInstall Meta CAPIMeta Events DeduplicationMeta CAPI Gateway
LinkedIn Server-side Tracking
Install LinkedIn Insight TagSet up LinkedIn CAPILinkedIn Events Deduplication
TikTok Server-side Tracking
Set up TikTok PixelInstall TikTok Events APITikTok Events Deduplication
Pinterest Server-side Tracking
Set up Pinterest TagConfigure Pinterest Conversions APIPinterest Events Deduplication
Snapchat Server-side Tracking
Set up Snap PixelSnapchat Conversions APISnapchat Events Deduplication
TAGGRS Tracking Tags and Tools
Tracking TagsGoogle Service Account integrationsGTM LogsProfit TrackingData Enricher ToolWebhooks TesterEnhanced Tracking ScriptMulti Domain ToolClick ID RecoveryConsent Tool
Configurations
Billy Grace Server-side TrackingLeadPages Server-side TrackingPiwik PRO Server-side TrackingCDN Server-side TrackingShopify Server-side TrackingActiveCampaign Server-side TrackingKlaviyo Server-side Tracking
Server-side Tracking for e-commerce
Shopify Data LayerShopware Data LayerMagento Data LayerWooCommerce Data LayerPrestashop Data LayerLightspeed Data Layer
Consent Management server-side
Activate Consent ModeConfigure TAGGRS with Axeptio

Prevent duplicate events in TikTok

By combining TikTok Pixel (client-side) with TikTok Events API (server-side), you get the best of both worlds: real-time feedback and reliable, resilient tracking. But to ensure accurate conversion attribution and consistent reporting, configuring TikTok Event Deduplication is essential. This approach identifies and merges duplicate events. So, when both the client-side (Pixel) and server-side (Events API) conversions share the same event_id and occur within a short time window, TikTok will count only one conversion.Follow this guide to set up Event Deduplication on TikTok and enable hybrid tracking correctly.

Generate a unique Event ID

  1. Use a random string, UUID, or a combination of timestamp and transaction ID for uniqueness.
  2. Generate the event_id in your website’s data layer or with a GTM Custom JavaScript variable.
Example Custom JavaScript Variable:

function() {
 return 'tt_evt_' + Date.now() + '_' + Math.floor(Math.random() * 100000);
}
Logo of TAGGRS Server-side Tracking: a light blue circle with two blue angle brackets
Expert insight:
‍
For e-commerce, combine order ID and timestamp for even stronger uniqueness.

Push the Event ID to the data layer

On the relevant event (e.g., purchase, add_to_cart), push the event_id along with other event data:

window.dataLayer.push({
  event: 'purchase',
  event_id: 'tt_evt_1721456789123_45678',
  // ...other parameters
});

Reference the Event ID in GTM web container (TikTok Pixel)

  1. Create a Data Layer Variable for event_id.
  2. Add the variable to your TikTok Pixel tag’s event configuration:

    Parameter name: event_id
    Value: {{DLV – event_id}}

Reference the Event ID in GTM server container (TikTok Events API Tag)

Create a data layer variable for event_id in the server container.
Add the event_id to your TikTok Events API HTTP Request payload:

json
{
 "event": "Purchase",
 "event_id": "{{event_id}}",
 "timestamp": {{Timestamp}},
 // ...user_data and custom_data
}

 Test deduplication

  1.  Use GTM Preview mode to ensure the same event_id is present in both client- and server-side events.
  2. In TikTok Events Manager, use the Test Events tool to verify deduplication is working.
  3. Check that only one conversion is counted per user action.

Best practices

Consistency:
Always generate and assign the event_id at the moment of the user action—before any tags fire.
‍
Parameter Naming:
Use the exact parameter name event_id in both Pixel and Events API implementations.
‍
Uniqueness:
Ensure your event_id is unique per event to avoid accidental deduplication of separate actions.
‍
Debugging:
Regularly monitor deduplication in TikTok Events Manager and resolve mismatches promptly.

Useful resources

TikTok server-side tracking - The full manual
Find expert support
Previous
TikTok Events API
Next
Pinterest Tag
Copyright © 2025 TAGGRS. All right reserved.
TABLE OF CONTENTS
Generate a unique Event IDPush the Event ID to the data layerReference the Event ID in GTM web container (TikTok Pixel)Reference the Event ID in GTM server container (TikTok Events API Tag)Test deduplicationBest practicesUseful resources