TikTok Events API
Server-side events to TikTok, deduplicated with the browser pixel.
PixelFox sends conversions to the TikTok Events API (v1.3, web events) and injects the
TikTok browser pixel (unless you already run one) firing the same event_id for
deduplication.
Credentials
| Field | Where to find it |
|---|---|
| Pixel code | TikTok Ads Manager → Tools → Events → Web events → your pixel → the code shown under the pixel name (starts with C…). (screenshot placeholder) |
| Access token | Same pixel → Settings → Events API → Generate Access Token. (screenshot placeholder) |
| Test event code (optional) | Same pixel → Test events tab. (screenshot placeholder) |
Paste them under Destinations → TikTok Events API in the PixelFox dashboard.
What gets sent
Conversion events map to TikTok standard events - ViewContent, AddToCart,
InitiateCheckout, CompletePayment, Search, SubmitForm, CompleteRegistration -
with:
event_id= the SDK event UUID (dedup against the browser pixel)user: SHA-256 hashed email (trimmed, lowercased), phone (E.164 digits) and external id; client IP, user agent and locale in the clear;ttclidwhen the visitor arrived from a TikTok ad andttpfrom TikTok's_ttpcookie. TikTok's web schema has no name or address fields, so those stay with Meta.properties:value,currency,contents(content_id,content_name,quantity,price) withnum_items, orcontent_ids;content_type,search_stringon Search,description,order_id;limited_data_usewhen you pass itpage: URL (required by TikTok; the store root stands in for server-side events) and referrer
TikTok deduplicates on event_source_id + event_id + event, so the browser pixel and
this call must fire the same event name with the same id - which the SDK and the GTM
template guarantee.
Server-side tagging with Google Tag Manager
TikTok's own guide for Events API through server-side GTM ("How to set up Events API for
server-side tagging in Google Tag Manager") has three parts: a browser pixel in the web
container, a server container that receives the GA4 transport, and an Events API tag in
that server container that forwards each event with an event_id shared with the pixel
so the two deduplicate. PixelFox gives you the same result two ways.
Option A - PixelFox sGTM hosting (recommended)
PixelFox is your server container. Nothing runs on Google Cloud and there is no Events API tag to configure - the TikTok credentials you pasted under Destinations are used for every event that arrives.
- Connect TikTok Events API under Destinations (pixel code, access token, test event code).
- Claim an sGTM hostname under sGTM hosting and add the CNAME - see sGTM hosting.
- Import
signals-web-sgtm.jsonfrom the GTM templates into your web container. Set theTikTok Pixel CodeandSGTM Server URLvariables. - Preview, fire a purchase, publish.
What the template does, mirroring TikTok's guide:
- Pixel in the browser -
TikTok Pixel - Base Codeloads the pixel on every page (ttq.page()); the event tags firettq.track()for ViewContent, AddToCart, InitiateCheckout, AddPaymentInfo, PlaceAnOrder, Search and CompleteRegistration withcontentsbuilt from the GA4itemsarray. - Deduplication - every TikTok tag passes
{ event_id: {{PixelFox Event ID}} }, the same id GA4 carries as theevent_idparameter. PixelFox sends that id asevent_idon the Events API call, so TikTok keeps one event per pair. TikTok's guide asks you to build a custom JavaScript variable for this; the template ships it. - Match keys - the Google Tag's shared event parameters carry
ttclid(from the landing URL) andttp(TikTok's_ttpcookie) on every hit. Push auser_dataobject into thedataLayer(GA4 enhanced-conversions shape:email_address,phone_number,address.first_name…) and the server-side event also carries the hashed email, phone, name and address. Keys the hit lacks are filled from the visitor's match profile. - Pixel-only or API-only - leave
TikTok Pixel Codeat its placeholder and the browser tags stay off (a blocking trigger), which is TikTok's "Events API only" setup; turn the destination off in PixelFox for pixel-only. TikTok recommends both.
Option B - your own Google sGTM container
If you already run a server container on Google Cloud, keep it and add TikTok's tag there, exactly as in TikTok's guide:
- Import
signals-web-sgtm.jsoninto the web container and pointSGTM Server URLat your own server container URL. - Import
signals-server-sgtm.jsoninto the server container - it adds the GA4 client that claims the hits. - From the Community Template Gallery add TikTok Events API (by TikTok). Fire it on All Events. Set Pixel Code and Access Token.
- In the tag, map Event ID to the incoming event parameter
event_id, TikTok Click ID tottclid, TikTok Cookie (_ttp) tottp, and the user fields to the GA4 user-provided data your page pushes. The tag hashes email and phone itself. - Use the Test Event Code field while checking Events Manager → Test events, then clear it.
In this setup TikTok receives the event from your server container; PixelFox still receives the same hit if you also keep the PixelFox ingest tag, but disable the TikTok destination in PixelFox so the event is not sent twice.
Verify
Use the Test events tab in TikTok Events Manager with the test event code configured in PixelFox - events arrive within seconds. TikTok's Event details panel shows which matching signals were received, and Event deduplication shows browser and server events collapsing when both are on.