Skip to content
Browse documentation

TikTok Events API

Report approved conversions server-side to a TikTok pixel with ttclid, hashed e-mail and phone, a test event code and logged, retried deliveries.

Last updated 3 min read

On this page

A TikTok Events API destination sends every matching conversion to your TikTok pixel from the server. It is set up on Integrations → Conversion APIs (/app/integrations?tab=conversion-apis) and needs the Admin role.

Before you start#

  • Pixel code — TikTok Ads Manager → Events → Web events → your pixel (for example C4ABCD1234).
  • Events API access token — the pixel's settings → Events API → Generate access token.
  • TikTok clicks should carry ttclid. TikTok appends it to the ad's landing URL; the tracker stores it from the tracking link or from the landing page in url=. You can also send it with the postback as ttclid=.

Add a destination#

  1. Open Integrations → Conversion APIs.
  2. On the TikTok Events API tile click Add.
  3. Fill in the form:
FieldNotes
NameOptional; defaults to TikTok Events API.
Pixel code6–40 letters or digits.
Events API access tokenStored encrypted; only a hint is shown again. Leave empty when editing to keep it.
SendApproved conversions, or Approved and pending.
ValueRevenue (default), Sale amount, Payout or No value.
OfferAll offers, or one offer.
Event codeEmpty = every non-private event.
Event namesOptional, one per line: our event code = TikTok event name.
Test event codeOptional. While set, events only appear under the pixel's test events.
StatusActive or Paused.
  1. Save.

Default event names#

Event codeTikTok event
default, leadSubmitForm
sale, purchaseCompletePayment
orderPlaceAnOrder
signup, registrationCompleteRegistration

Any other code without a line in Event names is sent as the code itself, so map custom codes explicitly:

Text
deposit = CompletePayment
trial = Subscribe

Test it#

  1. Copy a test event code from TikTok Events Manager and enter it as Test event code.
  2. Choose Send test event in the destination's menu. One synthetic event (the default event name, value 1 USD) is sent with the test code; the result shows TikTok's answer. The test is refused while no test event code is set.
  3. Clear the test event code to go live.

What is sent#

Each conversion becomes one POST to https://business-api.tiktok.com/open_api/v1.3/event/track/ with the header Access-Token: <token>:

JSON
{
  "event_source": "web",
  "event_source_id": "C4ABCD1234",
  "data": [{
    "event": "CompletePayment",
    "event_time": 1791624662,
    "event_id": "8a6a2d0e-3c55-4c7e-9a43-0c1c2d8f0b11",
    "user": {
      "ttclid": "E.C.P.v3Xyz…",
      "ip": "198.51.100.20",
      "user_agent": "Mozilla/5.0 …",
      "email": "<sha256>",
      "phone": "<sha256>",
      "external_id": "<sha256 of the click ID>"
    },
    "properties": { "value": 49.9, "currency": "USD", "order_id": "ORDER-1001" },
    "page": { "url": "https://shop.example.com/sale" }
  }],
  "test_event_code": "TEST12345"
}
FieldSource
event_idThe conversion ID, for de-duplication with the browser pixel.
ttclidThe postback's ttclid=, else the attributed click.
ip, user_agentThe attributed click (IP falls back to the conversion's IP).
email, phoneSHA-256 of the postback's email=/em= and phone=/ph= (already-hashed values passed through).
external_idSHA-256 of the TrackCrown click ID.
value, currencyPer Value, in the conversion's currency; omitted for No value.
order_idThe advertiser's order ID.
page.urlThe landing page the click was redirected to.

Delivery, retries and the log#

  • The worker sends conversions within seconds of approval (or creation, with Approved and pending).
  • TikTok answers errors with HTTP 200 and a non-zero code; TrackCrown treats those as failures. Codes 40000–49999 are permanent; others are retried.
  • 429, 5xx and network errors are retried after 1 min, 5 min, 30 min, 2 h and 6 h; other 4xx answers fail immediately.
  • The postback log keeps every payload (without the token) and TikTok's response. Each destination shows Sent 7 d and Failed 7 d.

Manage a destination#

Destination menu: Edit, Send test event, Pause / Resume, Delete. These destinations are not exposed through the REST API's /postbacks endpoints.

Troubleshooting#

ProblemFix
TikTok error 4xxxx: … in the logTikTok refused the request; the message says why (often a wrong token or pixel code). Fix it and regenerate the token for this pixel if needed.
Events without ttclidUse the tracking link as the ad's landing URL, or send ttclid= with the postback.
Custom event codes arrive as raw codesMap them under Event names.
Nothing is sentCheck Status, Send, the offer / event filter, and that the event is not private.

See also: Meta Conversions API · Ad costs & ROAS.

Something unclear or missing in this article?Tell us