TikTok Events API: server-side tracking and deduplication
The TikTok Events API reports conversions from your server so blocked pixels stop costing you sales data. Here is how it works, how to deduplicate with the pixel, and what to test.
By Mohammad Ayan · · 4 min read
TikTok's browser pixel misses sales for the same reasons Meta's does: ad blockers, privacy settings and in-app browsers. The TikTok Events API is the server-side answer. It lets your server report conversions directly, so the platform sees purchases the browser never delivered. This guide covers how it works, what it needs, and how to avoid counting the same sale twice.
What the Events API is
The Events API accepts conversion events over HTTPS from your server. You send an event name, a timestamp, the user's matching data, and any values such as order total and currency. Authentication uses an access token created for your pixel in TikTok Events Manager.
It is meant to run alongside the pixel, not replace it. The pixel covers behaviour in the browser, and the server covers the events that matter most, such as purchases.
Deduplication: send the same event ID twice
If the pixel and your server both report a purchase, TikTok needs a way to know it is one sale. The mechanism is a shared event ID.
- Generate one unique ID per event when it happens, for example an order number for a purchase.
- Pass that ID to the pixel call (
event_id). - Send the same ID, with the same event name, in the server request.
TikTok's documentation says deduplication is required when the pixel and the Events API report the same event, and that you must share event_id through both. It matches on the event name together with the event ID, and the copies must arrive within a 48-hour window of the first one. When it recognises a duplicate, TikTok keeps the first event it received. If the IDs differ, the names differ or one side omits the ID, you risk double counting.
You do not need deduplication if you split events between channels with no overlap, for example sending AddToCart only from the pixel and Purchase only from the server.
TikTok's developer documentation also describes a fallback that matches on the pixel code, the event name and the _ttp cookie value within a five-minute window. Treat that as a safety net, not a plan: a shared event ID is the reliable method. The same idea applies to Meta, explained in how Facebook Pixel and Conversions API deduplication works.
Matching data raises accuracy
Server events need something to tie them to a person who saw or clicked an ad. Useful fields include:
- the TikTok click ID (
ttclid), which TikTok appends to the landing page URL when someone clicks an ad, for web events, - the
ttpvalue, which the TikTok pixel stores in the_ttpcookie when cookies are enabled, - a hashed email address: trim spaces, lowercase, then SHA-256,
- a hashed phone number: convert to E.164 format first (for example
+12133734253), then SHA-256, - an
external_idfor your own customer ID, also SHA-256 hashed, - the visitor's IP address and user agent.
The more of these you send, the better the platform can attribute the conversion. Store the click ID and cookie value on the order at checkout, because for later events such as a delivery confirmation the browser is long gone. Cash-on-delivery tracking depends on exactly this.
Choosing which events to send
Start small. Report the events you optimise campaigns on, usually Purchase for a shop, and add steps such as AddToCart and InitiateCheckout once the first is stable. Use TikTok's standard event names exactly as listed in its help centre, because the list has changed over time and older names such as CompletePayment may appear in old tutorials. Sending events you never use adds work without improving optimisation.
TikTok recommends the Purchase event when placing an order and paying are the same moment. With cash on delivery they are not, which is why COD stores should report the order and the delivery separately.
Testing before you trust it
Events Manager has a test events tool that shows what TikTok receives from the pixel and from the server in near real time. Check that:
- both copies of the same action appear with the same event ID,
- the event name matches on both sides,
- values and currency are correct, and
- matching fields are present.
Compare a week of orders in your shop with reported conversions to see whether the gap has closed.
Common mistakes
- No shared event ID, which causes double counting.
- Different event names between pixel and server, so the pair never matches.
- Unhashed personal data. Hash email and phone before sending, and never send them in plain text.
- Dropping the click ID. Without it attribution quality falls.
- Putting the access token in front-end code. It belongs on the server only.
How PixelFox fits
PixelFox mints the event ID in the browser tag, fires the TikTok pixel with it, and sends the same ID from the server, so the pair collapses without you wiring it by hand. It does this for Meta and GA4 too, from a single pipeline. See also how to improve Event Match Quality for the matching-data side of the same problem.