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
- A server GTM container that already receives your GA4 events on your own subdomain. See Connect web GTM to your server container and Custom first-party tracking domains.
- A TikTok Ads account with a pixel in Events Manager.
- Ecommerce events in GA4 format (
view_item,add_to_cart,begin_checkout,purchasewith anitemsarray).
Step 1: Get the Pixel ID and access token
- 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.
- In the pixel's Settings, under Events API, choose Generate Access Token. Copy it.
- 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
- In your server container: Templates → Tag Templates → Search Gallery → TikTok Events API (Official) by TikTok → Add to workspace.
- Create a tag from it. Fill in Pixel ID and Access Token.
- 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. - Trigger: Custom, Client Name equals
GA4and 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 event | TikTok event |
|---|---|
page_view | Pageview |
view_item | ViewContent |
search | Search |
add_to_wishlist | AddToWishlist |
add_to_cart | AddToCart |
begin_checkout | InitiateCheckout |
add_payment_info | AddPaymentInfo |
purchase | CompletePayment |
sign_up | CompleteRegistration |
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
ttclidin the page address (and in the referrer when it is your own site), then in attclidcookie. When it finds one, it sets thettclidcookie 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
_ttpcookie 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_addressanduser_data.phone_numberfrom 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
- In TikTok Events Manager, open your pixel → Test Events and copy the test event code into the tag's Test Event Code field.
- Start Preview in the web and server containers, browse your site, add to cart and place a test order.
- In server Preview, open the TikTok tag → Outgoing HTTP Requests: the request to TikTok should answer with code 0 (success).
- Check that the events appear in Test Events with the right value and currency.
- 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.
Related reading
- Meta Conversions API with server-side GTM
- Shopify server-side tracking with GTM
- WooCommerce server-side tracking with GTM
Sources
Get new articles in your inbox
New guides on tracking and analytics, once or twice a month. No spam, unsubscribe any time.