Skip to main content
FHAVI

Free resource

TikTok tracking, both halves

TikTok's setup mirrors Meta's: a browser pixel for what it can see, an Events API for what it cannot, and an event id joining the two. The failure modes are also the same, which is why a store that has already fixed Meta usually gets this right in an afternoon.

Before you start

Two things that decide the whole build

First, decide which events you actually need. TikTok's standard events that carry commercial meaning for a store are ViewContent, AddToCart, InitiateCheckout and CompletePayment — note the last one: TikTok calls a completed sale CompletePayment, not Purchase, and sending a custom “Purchase” gives you an event nobody can optimise on.

Second, treat the access token like a password. It lives in the server environment or an encrypted settings row, never in the JavaScript bundle, and one token covers one data source — the same way a Meta CAPI token does.

Part 1

The browser pixel

01

Checks

  1. The base code loads once per page, not once per component — a duplicated snippet doubles every event.
  2. ViewContent fires on a product page with a content id that matches your catalogue, plus value and currency.
  3. AddToCart fires once per add, with quantity and value that match the price actually charged.
  4. InitiateCheckout fires when the checkout starts, not on every keystroke or cart drawer open.
  5. CompletePayment fires on the order confirmation page — and only once, which in a single-page checkout means guarding against re-render.
  6. Sending a fake test event into a live pixel is not a test: it teaches the algorithm the wrong thing for weeks.

Part 2

The Events API half

02

Checks

  1. The access token is generated in the data source settings and stored server-side.
  2. CompletePayment is sent from the server on order confirmation or payment success, so a blocked browser does not lose the sale.
  3. The server event carries the order number as its event id, so a retry cannot create a second conversion.
  4. Hashed email and phone are included — the same normalisation rules as Meta apply, including country code on phone numbers.
  5. Client IP and user agent are forwarded, plus the TikTok click id when an ad click carries one.
  6. Consent state is respected: a visitor who denied advertising storage should not produce server-side advertising events either.

Part 3

Proving it works

03

The test that settles it

  1. Place one order on your own phone number, cash on delivery, in a clean browser profile.
  2. In TikTok Events Manager, confirm the event appears twice — one browser, one server — with the same event id.
  3. Confirm they are shown as deduplicated, not as two separate conversions.
  4. Cancel the order afterwards, and check that the platform does not reverse a conversion you legitimately cancelled — this is why the deduplication check matters more than the count.
  5. Re-run the same check after any checkout change, because that is where these integrations break.
04

What a failure looks like

  1. Browser only → the token is wrong or the server send is failing silently.
  2. Server only → the pixel is blocked for that visitor, which is normal in a clean browser but not in an incognito one.
  3. Two events, not deduplicated → the ids do not match, and your reported conversions are overstated.
  4. Nothing at all → you are looking at the wrong data source, or the event name is wrong (a custom Purchase rather than CompletePayment is the usual culprit).

Keep going

The rest of the library

Every checklist here is free and ungated. The research pages carry the reasoning behind them.

All resources · Research library

Running TikTok and Meta and the numbers disagree?

That is usually attribution windows rather than tracking. Send both reports for the same week and we will tell you which it is.

Prefer email? Write to md@fhavi.com