25% off Server GTM for 12 months

Claim 25% off

TikTok Events API with Server-Side GTM: Setup Guide

November 11, 2026 5 min read

The short answer: To send TikTok conversions server-side, add TikTok's own "TikTok Events API (Official)" tag from the Community Template Gallery to your server GTM container, give it your Pixel ID and an Events API access token from TikTok Events Manager, and fire it on the GA4 events your server container already receives. The tag turns GA4 events into TikTok events by itself (for example purchase becomes CompletePayment), reads the ttclid click ID from the page address and keeps it in a first-party cookie for 30 days. If you also keep the TikTok browser pixel, send the same event ID from both so TikTok removes duplicates.

We read the code of TikTok's official template (github.com/tiktok/gtm-template-eapi) for this guide, so the event names and cookie details below are what the template actually does, not a summary of other articles.

What you need

Step 1: Get the Pixel ID and access token

  1. In TikTok Ads Manager, open Tools → Events → Web Events (Events Manager) and pick your pixel, or create one. Choosing the server-side Google Tag Manager option creates the pixel for you and shows its ID.
  2. In the pixel's Settings, under Events API, choose Generate Access Token. Copy it.
  3. Keep the token private. In GTM, store it in a Constant variable so it is not typed into many tags.

Step 2: Add the official tag to the server container

  1. In your server container: Templates → Tag Templates → Search Gallery → TikTok Events API (Official) by TikTok → Add to workspace.
  2. Create a tag from it. Fill in Pixel ID and Access Token.
  3. Leave Event Name on its default, {{Event Name}}. The tag then maps each GA4 event to TikTok's name (table below), so one tag handles every event.
  4. Trigger: Custom, Client Name equals GA4 and Event Name matches the events you want, for example ^(page_view|view_item|add_to_cart|begin_checkout|add_payment_info|purchase|search|sign_up)$.

How GA4 events become TikTok events

The template has this mapping built in:

GA4 eventTikTok event
page_viewPageview
view_itemViewContent
searchSearch
add_to_wishlistAddToWishlist
add_to_cartAddToCart
begin_checkoutInitiateCheckout
add_payment_infoAddPaymentInfo
purchaseCompletePayment
sign_upCompleteRegistration

It also builds TikTok's contents (product ID, name, category, price, quantity), value and currency from the GA4 items array. For anything else, the Parameter Override section lets you set the TikTok event and its parameters yourself. Other TikTok events in the list include PlaceAnOrder, SubmitForm, Contact and Subscribe.

Click IDs and cookies: what the tag does

  • ttclid: the tag looks for ttclid in the page address (and in the referrer when it is your own site), then in a ttclid cookie. When it finds one, it sets the ttclid cookie for 30 days from your server. Because your server runs on your own subdomain, that is a first-party cookie, which Safari keeps instead of cutting it to 7 days like script-set cookies.
  • _ttp: the tag reads the _ttp cookie that TikTok's browser pixel sets and sends it with the event. If you use the Events API alone with no pixel, there is no _ttp, so matching relies more on the click ID and customer data.
  • Customer data: email, phone and external ID can be sent raw or already hashed; the tag hashes raw values with SHA-256 before sending. It also picks up user_data.email_address and user_data.phone_number from the GA4 event by itself. More matched data means a better match rate in TikTok.

Step 3: Avoid double counting

If the TikTok browser pixel still runs on your site, TikTok gets every conversion twice. Send the same Event ID from the pixel and from the server tag (the tag's De-duplication setting), and TikTok keeps one. The simplest way: create a unique event ID in the web container, send it with the GA4 event as a parameter, and use it in both places. If you follow TikTok's own Events Manager setup flow for GTM, it configures this event ID for you.

Or remove the TikTok browser pixel and send everything server-side. You lose _ttp but avoid duplicates entirely.

Cash-on-delivery stores: PlaceAnOrder vs CompletePayment

For COD orders the money has not been paid when the shopper clicks "order". Sending CompletePayment at that moment teaches TikTok that fake or cancelled orders are sales. Two options:

  • Send PlaceAnOrder at checkout (Parameter Override) and CompletePayment only when the order is delivered or confirmed.
  • On Taglinc, COD Order Protection holds COD purchases and sends them to TikTok, Meta, GA4 and Google Ads only when you confirm the order, with the original order time and click.

Step 4: Test

  1. In TikTok Events Manager, open your pixel → Test Events and copy the test event code into the tag's Test Event Code field.
  2. Start Preview in the web and server containers, browse your site, add to cart and place a test order.
  3. In server Preview, open the TikTok tag → Outgoing HTTP Requests: the request to TikTok should answer with code 0 (success).
  4. Check that the events appear in Test Events with the right value and currency.
  5. Remove the test event code before you publish, or real events will only show as tests.

FAQ

Is the TikTok Events API free?

Yes. TikTok does not charge for it. You pay only for the server that runs your server container.

Do I need the TikTok pixel as well?

No, but it helps matching through the _ttp cookie. Many advertisers run both with a shared event ID.

Why is purchase called CompletePayment?

That is TikTok's standard event name for a paid order. The official template maps GA4 purchase to it automatically.

How many requests does this add?

None on your server's incoming side: the browser still sends one GA4 request per event, and the server container sends it on to TikTok. On Taglinc, plans count incoming requests only.

Sources

Get new articles in your inbox

New guides on tracking and analytics, once or twice a month. No spam, unsubscribe any time.