Blog

Set up TikTok Events API server-side in 12 steps

Each step has a verification check. If you skip any, the next one will not work, and the error message will not tell you which.

TikTok's Events API documentation is correct but scattered. This is the same setup compressed into 12 ordered steps with a verification check at each one. If a step fails, fix it before continuing; later steps assume the earlier ones worked.

  1. Create a TikTok Pixel. In TikTok Ads Manager, Assets > Events > Web Events > Set Up Web Events. Pick the Pixel name and connection method (Events API).
  2. Generate an access token. In the Pixel settings, click Get Access Token. The token is shown once. Copy it to your password manager immediately.
  3. Note the Pixel ID. 24-character alphanumeric. You will paste this into the sGTM tag template.
  4. Add the TikTok Events API tag template. In your sGTM container, search the gallery for "TikTok Events API." Multiple options exist; the official one is from TikTok.
  5. Configure the tag. Paste the Pixel ID, paste the access token, set the test event code if you want to verify in the test tool first.
  6. Set the trigger. Use the same event names TikTok expects: ViewContent, AddToCart, InitiateCheckout, CompletePayment. Mapping non-standard event names to TikTok ones is a common gotcha.
  7. Map user_data fields. At minimum: hashed email, hashed phone, ttp cookie value, ttclid from URL. The user_data extraction patterns apply.
  8. Map content fields for ecommerce. contents (array), value, currency. TikTok's contents shape differs slightly from Meta's; check the field names.
  9. Add event_id for deduplication. Same shared ID as your TikTok Pixel uses. Without this you will double-count.
  10. Test in the TikTok test tool. Generate a test event code, fire a real conversion on your site, watch the Test Events tab in TikTok Events Manager. Should appear within 30 seconds.
  11. Remove the test code, publish. Once verified, clear the test_event_code field from your tag and publish a new container version. The tag now sends to production.
  12. Check match quality after 24-48 hours. In TikTok Events Manager, the match quality score shows up after enough events have flowed. Aim for above 75. If below 60, work through the low-match-rate diagnostic.

Common skips

The two steps most teams skip are 7 (mapping user_data fields beyond email) and 9 (event_id deduplication). Both are doable later, but doing them upfront avoids the rework when match rates come in low.