Skip to content

Using the TikTok API for tracking conversions

You can send conversions to TikTok server-to-server through the TikTok Events API. FunnelFlux fires a postback URL to a relay, and the relay sends the event to your TikTok pixel. This integration may not cover every TikTok Events API feature.

You need:

  1. A TikTok Ads Manager account
  2. A TikTok pixel and its pixel ID
  3. An Events API access token for that pixel

TikTok generates Events API access tokens in Events Manager.

  1. Sign in to TikTok Ads Manager.
  2. Go to Tools > Events Manager.
  3. Under Data sources, select your web pixel.
  4. Open the pixel’s Settings tab.
  5. In the Events API section, click Generate Access Token.
  6. Copy the access token and the pixel ID to a text editor.

If you lose the token, generate a new one the same way. See TikTok’s Events API guide for details.

Step 2: Set up TikTok as a traffic source in FunnelFlux

Section titled “Step 2: Set up TikTok as a traffic source in FunnelFlux”

In FunnelFlux, go to the traffic sources page and create a new one. There is no TikTok template, so add the tracking field yourself.

You only need to capture one tracking field: the click ID, ttclid.

TikTok traffic source with a single tracking field ttclid = CALLBACK_PARAM

In the conversion tracking part, choose Postback URL.

The postback URL is long, so copy the content below to a text editor where you can edit it carefully:

https://functions.funnelflux.pro/tiktok-s2s-api
?vid={flux_hid}&ttclid={trackingfield-ttclid}&currency=USD&revenue={flux_payout}&ip={connection-ip}&user_agent={connection-useragent}&page_url={page-url}
&access_token=YOUR_ACCESS_TOKEN
&pixel_id=PIXEL_ID
&event_name=EVENT_NAME

Then:

  • Replace YOUR_ACCESS_TOKEN with your access token.
  • Replace PIXEL_ID with your pixel ID.
  • Replace EVENT_NAME with a valid event name (see below).
  • Collapse it into a single line by removing the line breaks, then paste it into the postback URL box.

Note: make sure you remove the line breaks. If you paste it as is, it may look correct in the FunnelFlux UI, but the URL will contain extra characters that break it.

Use one of TikTok’s standard events. TikTok lists them in About standard events.

These were available at the time of writing:

ViewContent
ClickButton
Search
AddToWishlist
AddToCart
InitiateCheckout
AddPaymentInfo
CompletePayment
PlaceOrder
Contact
Download
SubmitForm
CompleteRegistration
Subscribe

The integration passes the revenue value from your conversion and a currency value of USD.