Most. Help

TikTok Events API Server-Side GTM: Setup Guide

Published Sep 3, 2026Updated Sep 13, 20268 min readIntermediate
Hand-drawn browser sending paper planes through a server rack with a tag to a smartphone with a music-note flag, symbolizing TikTok events via server-side GTM
What you'll learn
  • How to generate a TikTok Events API access token and connect it to a GTM server container
  • How to configure TikTok Event tags inside Google Tag Manager for server-side delivery
  • How to enable event deduplication so browser pixel and server events do not double-count
  • How to verify your setup with TikTok Events Manager test events
Intermediate

TikTok Events API Server-Side GTM: Setup Guide

Browser pixels lose events to ad blockers and cookie restrictions. A TikTok Events API server-side GTM setup sends conversion data from your own tag container, restores those lost signals, and improves match quality. This guide walks through token generation, container setup, tag configuration, deduplication, and testing.

Why use TikTok Events API server-side GTM?

When a user converts on your site, the browser pixel fires a client-side request to TikTok. Ad blockers intercept that request. Safari ITP strips identifiers. The result: incomplete conversion data, lower match rates, and less accurate bidding.

A GTM server container receives the event on your own subdomain, enriches it with hashed customer data, and forwards it to the TikTok Events API endpoint. Because the request originates from a server, no browser extension can block it.

Teams that already run server-side tagging for Meta will find the architecture familiar. How Meta treats server-side events under AEM is covered in Facebook Aggregated Event Measurement.

Prerequisites

Before starting, confirm you have:

  • A TikTok for Business account with at least one pixel created in Events Manager.
  • A Google Tag Manager account with a server container deployed and receiving events from your web container.
  • Admin permissions in both TikTok Events Manager and GTM.
  • A custom subdomain (for example, metrics.yourbrand.example) pointed at your server container.

If you have not yet deployed a server container, Google provides step-by-step instructions in their server-side tagging documentation.

Step 1: Generate an Events API access token

  1. Open TikTok Events Manager and select your pixel.
  2. Navigate to Settings and scroll to the Events API section.
  3. Click Generate access token.
  4. Copy the token immediately. TikTok displays it only once.
  5. Store the token in a secrets manager or GTM server-side variable. Never hard-code it in client-side code.

The token ties events to your pixel. If you rotate it, all server tags using the old token stop delivering until you update them.

Step 2: Configure the server container endpoint

In your GTM web container, set the server container URL in the Google tag configuration:

js
// gtag.js configuration
gtag('config', 'G-XXXXXXX', {
  transport_url: 'your-container.example',
  first_party_collection: true
});

Replace your-container.example with the subdomain you mapped to your server container. All supported tags in the web container now relay hits to that endpoint instead of calling third-party domains directly.

Step 3: Add a TikTok Events API tag to the server container

  1. In the GTM server container, go to Templates and search the gallery for "TikTok Events API" (published by Stape or AddingWell).
  2. Create a new tag using that template.
  3. Fill in the required fields:
FieldValue
Pixel CodeYour TikTok Pixel ID from Events Manager
Access TokenThe token generated in Step 1
Event NameA GTM variable that maps the incoming event name
  1. Under User Data, map hashed identifiers:
json
{
  "user_data": {
    "em": "{{SHA256 Email}}",
    "ph": "{{SHA256 Phone}}",
    "external_id": "{{SHA256 UserID}}"
  }
}
  1. Set the trigger to fire on the events you want forwarded (Purchase, AddToCart, CompleteRegistration, etc.).

The tag hashes identifiers with SHA-256 before sending. TikTok rejects unhashed email or phone values.

For teams that prefer a managed solution without manual tag wiring, MOST automates conversion routing across TikTok, Meta, and other platforms from a single dashboard.

Step 4: Enable event deduplication

Without deduplication, every conversion arrives twice: once from the browser pixel, once from the server tag. TikTok counts both, inflating your numbers.

The fix is a shared event_id. Generate a UUID at the moment of conversion and attach it to both the client pixel call and the server event:

js
// Client pixel (web container)
ttq.track('Purchase', {
  value: 49.99,
  currency: 'USD'
}, {
  event_id: '{{Event UUID}}'
});

In the server tag, pass the same UUID through the event_id field. TikTok's deduplication logic matches on the combination of event_id and event_name within a 48-hour window.

For a deeper explanation of how deduplication interacts with attribution windows, see Event Deduplication.

Step 5: Verify with Events Manager test events

  1. In TikTok Events Manager, open Test Events.
  2. Enter your website URL and click Start testing.
  3. Trigger a test conversion on your site.
  4. In the test feed, confirm you see:
    • The event arriving with source labeled Server.
    • A deduplication badge if the browser pixel also fired.
    • Matched identifiers (email, phone) showing a quality score.

If the event shows source Browser only, your server tag is not firing. Check the GTM preview mode for errors.

Events API allows you to send web events directly from your server to TikTok, providing a more reliable and privacy-compliant data pipeline.

- TikTok Business Help Center, https://ads.tiktok.com/help/article/getting-started-events-api

Troubleshooting common issues

SymptomLikely causeFix
Zero server events in Test EventsTag not firingOpen GTM Preview, confirm trigger matches event name exactly
Events arrive but match rate is 0%User data not hashedWrap email/phone in SHA-256 before passing to the tag
Duplicate counts in reportingMissing event_idGenerate a UUID per conversion and pass it to both pixel and server tag
401 errors in server logsToken revoked or expiredRegenerate the token in Events Manager and update the GTM variable

If you manage multiple ad accounts or run campaigns across several platforms, Pixel Activator provides a free way to validate pixel firing before you scale spend.

Next steps

  • Add standard events for AddToCart, InitiateCheckout, and CompleteRegistration. TikTok's standard events reference lists all supported names and parameters.
  • Monitor the Event Match Quality score in Events Manager weekly. Aim above 6.0.
  • If you also run Meta CAPI, align your server-side tracking architecture so both platforms share the same UUID strategy.

Frequently asked questions

Sources

Sources

Was this guide helpful?
Author
Most Team
Справочная служба

Официальные руководства и глоссарий для платформы Most и Активатора пикселей.

Topic
TikTok Events API and Pixel: Setup and Diagnostics Guide
Main article of the topic
Related articles

Related guides