← Guides·Server-Side Tagging

Server-Side Tagging

TikTok server-side tracking, Meta CAPI and Google Ads

Set up TikTok Events API next to the Pixel, then Meta CAPI and Google Ads from a server container: payloads, match keys, deduplication and tests.

Rafael CampoamorDigital Marketing Freelancer
9 min read · 2047 words

TikTok server-side tracking means sending your conversions to TikTok’s Events API from a server, next to the TikTok Pixel in the browser, with the same event_id on both so TikTok counts each conversion once. Meta’s Conversions API (CAPI) and Google Ads conversion tags in a server container follow the same pattern with their own rules, so one server container usually feeds all three.

This guide starts with TikTok, because its Events API has the most fields to get right, then covers Meta CAPI and Google Ads, the rollout, and how to keep the three in agreement after release. It assumes a working server container; if you don’t have one yet, follow our GTM server-side setup first. For the concept and the trade-offs, see the pillar on server-side tracking.

The three conversion APIs side by side

TikTok Events APIMeta Conversions APIGoogle Ads in server-side GTM
Browser counterpartTikTok PixelMeta PixelGoogle tag and Google Ads tags
Event ID for deduplicationevent_id, same as the Pixel’sevent_id, same as the Pixel’s eventIDRemove the browser tag once the server tag works
Deduplication window48 hours48 hoursNot applicable
Fallback key_ttp cookiefbp and/or external_idNot applicable
Main match keysttclid, _ttp, hashed email, phone, external_id, IP, user agentHashed email and phone; fbp, fbc, IP and user agent unhashedUser-provided data for enhanced conversions

The table hides one shared rule: every platform needs the same identifier on the browser event and the server event. Most double-counting comes from that ID being generated twice.

TikTok Events API: set it up

TikTok’s documentation calls the Events API a reliable connection between TikTok and your marketing data, and recommends setting it up as a second channel together with the Pixel. Pixel or Events API setup is also a prerequisite for the Web Conversions objective in TikTok Ads Manager.

Pick the integration route

TikTok lists three ways in:

What the GTM setup flow creates

TikTok documents every item the setup flow adds to your containers, which is useful when you audit them later:

ContainerItemWhat it does
WebGoogle tag TT-{PixelCode}-Web-Tag-GA4_ConfigSets the tagging server URL
WebGA4 Event tag TT-{PixelCode}-Web-Tag-GA4_EventDefines the data sent to the tagging server
WebCustom HTML and TikTok Pixel tagsInstall the Pixel and send browser events
WebCustom JavaScript variables for user data, items, currency, value, external ID and event IDFeed the server-side events
ServerTag from the TikTok Events API (Official) templateSends server events to the Events API
ServerCustom trigger TT-{PixelCode}-Server-Trigger-All_EventSelects the events to send

The event ID variable is the one that makes deduplication work: the flow configures it for you. In a manual setup, TikTok suggests a custom JavaScript variable for the event_id.

The request, field by field

Every route ends in the same call. TikTok’s Events API 2.0 reference defines it as a POST to https://business-api.tiktok.com/open_api/v1.3/event/track/, with an Access-Token header:

{
  "event_source": "web",
  "event_source_id": "YOUR_PIXEL_CODE",
  "data": [{
    "event": "Purchase",
    "event_time": 1763290000,
    "event_id": "order_10482",
    "user": {
      "ttclid": "E.C.P.…",
      "ttp": "value of the _ttp cookie",
      "email": "sha256 of the normalized email",
      "ip": "203.0.113.1",
      "user_agent": "Mozilla/5.0 …"
    },
    "page": { "url": "https://www.example.com/checkout/thanks" },
    "properties": { "currency": "EUR", "value": 120.00, "content_type": "product",
      "contents": [{ "content_id": "SKU-123", "price": 60.00 }] }
  }]
}

Match keys and hashing

TikTok matches server events to its users with click IDs, advanced matching and signals such as IP and user agent, and recommends sending several kinds at once.

FieldHash it?Rule from TikTok’s docs
ttclidNoThe click ID TikTok appends to the landing page URL
ttpNoThe value of the _ttp first-party cookie the Pixel sets
emailSHA-256Trim spaces and lowercase before hashing
phoneSHA-256Normalize to E.164 (+12133734253) before hashing
external_idSHA-256Your own user, loyalty or cookie ID
ip, user_agentNoSend both together

The common bug is hashing before normalizing. A hashed email with a trailing space is a different hash, and it never matches.

Deduplication with the Pixel

TikTok deduplicates on three values: event_source_id, the event name and event_id. According to TikTok’s deduplication documentation:

On the Pixel, the ID is the third argument of the track call:

ttq.track('Purchase', { value: 120.00, currency: 'EUR' }, { event_id: 'order_10482' });

Without event_id, TikTok can deduplicate on the _ttp cookie instead, with tighter limits: a 5-minute window, and it only ever drops the server event, never the browser one. To use it, leave event_id out of the Events API payload altogether.

Test before production

  1. In Events Manager, open the Pixel and go to Test Events. Copy the test code.
  2. Add it as test_event_code to the request body and send an event.
  3. Look for the event under Event Activity. Payload problems show up there.
  4. Remove test_event_code before going to production.

On the Pixel’s overview, the connection method should read Server & Browser. If the Server & Browser numbers stay low, TikTok’s advice is to check that the event_id is identical on both sides.

TikTok’s help article on the Events API is the entry point to these documents. For TikTok Smart+ campaigns specifically, our TikTok Smart+ tracking setup covers routing and QA, and the TikTok Pixel Helper guide covers the browser side.

Meta Conversions API from the server container

Meta recommends running the Conversions API alongside the Meta Pixel, and Meta’s deduplication guide sets the rules:

In a server container, a CAPI tag reads the GA4 event and maps its fields to Meta’s parameters. See Meta’s Conversions API documentation for the full reference and Meta’s CAPI parameter list for customer information fields: email and phone are hashed, while fbp, fbc, IP address and user agent must not be. Our posts on Meta CAPI validation and CAPI deduplication issues cover what usually goes wrong.

Google Ads doesn’t need a separate API call from a server container. Google’s server-side Ads guide uses the GA4 stream the container already receives:

  1. Add a Conversion Linker tag to the server container.
  2. Mark the conversion as a key event in GA4 and send it with a GA4 Event tag from the web container.
  3. Add a Google Ads Conversion Tracking tag to the server container with the conversion ID and label, triggered by the same event name. It reads transaction ID, value and currency from the ecommerce fields.
  4. For enhanced conversions, pass a User-Provided Data variable as the user_data parameter of the Google tag. Hashed values go in keys with the sha256_ prefix.
  5. Check the Tags and Console tabs in the server container’s preview, then remove the matching Ads tags from the web container so conversions aren’t counted twice.

Remarketing needs its own server-side setup; Google’s guide links to it. For enhanced conversions in more depth, see our guide to enhanced conversions for Google Ads.

Roll it out without double counting

  1. Audit. List the conversions each platform receives today, with their parameters.
  2. Pilot. Send one low-impact event (a view or add-to-cart) through the server while the Pixel keeps running.
  3. Compare. Check each platform’s diagnostics: TikTok’s Test Events and connection method, Meta’s Events Manager, and the server container’s preview for Google Ads.
  4. Move the conversions that matter. Purchase, lead and sign-up, each with a shared event ID.
  5. Decide on the browser tags. TikTok and Meta recommend keeping their Pixels next to the server; for Google Ads, the server tag replaces the browser one.

Consent doesn’t change because the request now leaves from a server. Where the visitor’s choice is checked in a server container is covered in consent-aware server-side tracking.

Keep the three platforms in agreement

Each platform shows its own diagnostics, and none of them shows the other two. A template update that drops event_id on TikTok, a GA4 change that empties value, or a trigger that stops matching after a web release shows up in each platform as fewer conversions, weeks later, as a performance problem.

Trackingplan sees the conversions where they are sent: the Pixel hits in the browser and, with its tag for server-side GTM, the requests your server tags send to TikTok, Meta, Google Ads and the rest. It flags missing properties, duplicate fires and broken triggers on real traffic. When the server container forwards a conversion to Meta, TikTok or another destination, Trackingplan reads the Google Consent Mode state the container copied from the browser event, so you can check that each destination only received data from visitors who accepted. For TikTok Pixel events, it lists every product the contents array carries, so a missing product ID shows up per item. Setup steps are in Trackingplan in a server-side setup.

FAQ

What is TikTok server-side tracking?

It is sending your website’s conversion events to TikTok’s Events API from a server, instead of only from the TikTok Pixel in the browser. TikTok recommends running both together, with the same event_id on the Pixel event and the Events API event, so each conversion counts once.

Do I need the TikTok Pixel if I use the Events API?

TikTok recommends both. Its documentation describes the Events API as a second channel next to the Pixel, and calls the combined Pixel and Events API setup through server-side GTM the recommended option for event coverage, campaign performance and automatic deduplication.

How does TikTok deduplicate Pixel and Events API events?

By event_source_id (the Pixel Code), the event name and event_id. TikTok keeps the first event and discards duplicates received within 48 hours; a duplicate received within 5 minutes is merged into the first. Without event_id, TikTok can fall back to the _ttp cookie, but only within 5 minutes and only dropping server events.

Which user data should I send to the TikTok Events API?

As many match keys as you lawfully can: ttclid from the landing URL, the _ttp cookie value, IP address and user agent unhashed, and email, phone and external_id hashed with SHA-256 after normalizing them as TikTok describes.

Can one server container send to TikTok, Meta and Google Ads?

Yes. A server-side GTM container receives one stream of events, usually GA4, and separate tags forward them to each platform: TikTok’s official Events API tag, a Meta Conversions API tag and Google Ads Conversion Tracking. Each platform keeps its own rules for tokens, match keys and deduplication.

Rafael CampoamorDigital Marketing Freelancer

Digital Marketing Freelancer

Trackingplan

See everything. Miss nothing.

Your implementations audited around the clock with real-time, real-user data. Real-time alerts about errors or changes in your data, campaigns, pixels, privacy and consent. Let AI flag issues before they cost you.