Need to use the TikTok server-to-server API to track conversions? Got you covered.

We have added Custom Scenarios to FunnelFlux Pro to cover this.

Here's what you need:

  1. A TikTok account, obviously

  2. A pixel and its ID -- and you must be the owner of the pixel

  3. A few minutes of spare time


Preface - Creating Pixels and Priming Events

A lot of users have been asking about this, and TikTok has recently updated their UI around pixel creation.

Creating a pixel

  1. When creating a pixel, choose developer mode. The standard mode forces you to create URL/click-based rules and is a annoying in that sense

  2. If you want the ease of making "click this button > trigger this event", I suggest using Google Tag Manager instead and still using the developer pixel

  3. Once you create the developer pixel, you will want to test it and prime events so that you can select them as optimisation targets in your campaigns. See below.

Testing and priming events

Annoyingly, if you don't have event data sent already, your event doesn't come up as "active" and you can't select it in your campaign. A bit of chicken and egg no?

To help with this, I have made a pixel-priming page for you.

https://test-resources.funnelflux.pro/tiktok/pixel-test.html?pixel=XXX

Replace the XXX with your pixel ID and load this page. The page should say the ID that was loaded, and you have a number of buttons that will trigger TikTok events.

  1. If you want to verify a standard pixel, you can use the above URL with your pixel ID included as the verification URL. It should verify fine using that

  2. If you click your pixel in TikTok's UI > test events tab, you can use this URL to generate QR code and test on your mobile device. Click the various buttons and you should see test event appear

  3. Load this URL in your browser normally and click each button 3-5 times to spam them with some events. Wait a few minutes and refresh the pixel settings in TikTok, and you should see your events there.

Once you have done #3 above, all these events should appear as active for the pixel in your campaign setup, allowing you to select them as optimisation events. Yay!


Setting up the Events API for Conversion Tracking

It is not clear in TikTok's documentation, but if you are not the owner of the pixel (e.g. you were just shared access to it), then your access token will not have permission to send conversion events to that pixel via the API.

If a pixel was shared to you, you will need to ask the owner to do the action below and then give you the access token produced.


Step 1 - Generate an Access Token

Firstly you will need to generate an access token that allows our TikTok conversion API app to access your account and its pixels.

There are two ways to do this.

METHOD 1

Log into TikTok (the account with the pixels you want to use), then load this URL in your browser > CLICK ME

This should take you to an authentication screen like so:

Tick the agree checkbox and click the confirm box.

This process is generating an advertiser-level access token that should have access to all your pixels. If you have multiple pixels use this, as you only need the single access token for all integrations.

Wait a few seconds as it will redirect to one of our URLs that will provide you with your access token to the account.

After a few seconds you should see a page with content like this:

Copy this Access Token value to a text editor. If you ever lose it, you can just go through the steps above to regenerate one.

METHOD 2

Go to your pixel settings in the TikTok UI > Settings tab

Choose the option "Use another account's TikTok Developer app" and enter this ID:

6930258772682080257

This will generate a pixel-level access token, which will only work for this pixel. Keep this in mind as if you try to use it for other pixels it will not work.

NOTE: There is a TikTok issue at the moment where sometimes it will say this app does not exist. If this happens, use method 1. It's a known bug they are fixing.


Step 2 - Set up TikTok as a Traffic Source in FunnelFlux

In FunnelFlux, go to the traffic sources page and create a new one.

Start typing Tik... in the name and select the TikTok template.

This will fill out the data passing section like so:

Here the one we critically need is the external field, which will work fine, and is currently set to capture the ttclid parameter.

For the others, at time of writing I am unsure if these tokens actually work as they are for view/click attribution through measurement partners... but why not! TikTok might enable them later even if they don't produce useful data now.

Now head to the conversion tracking tab, pick Custom Scenario > TikTok:

Here you need to:

  • Paste your access token that you generated earlier. Ensure that this does not have an errant whitespace before/after

  • Place your pixel ID, which you can get from the TikTok UI

  • Declare an event name

Right now, you can only send a single event name here (though see my note below).

The TikTok standard events are documented here (use the table of contents on the right-hand side).

These are the available events as of writing:

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

We automatically pass the revenue value from your conversion and a currency value of USD.

And that's it! You should now track TikTok events via S2S.

Note: if you have multiple conversion types happening via using our txid value in postbacks, you could put {txid} as the value of Event Name to align things. So at your network you could set the postback for leads to have tx=CompleteRegistration, for purchases to have tx=CompletePayment, etc.


Intended Updates

Templates

We will update our templates to select and better populate the custom scenario section (right now you still have to manually swap to it, and there are no obvious links to this documentation).

Data Passing

We plan to automatically pass the following as well, in a later update. We will do something similar with our FB conversion tracking scenario.

  • content_type - category of offer that converted

  • content_id - FunnelFlux ID of the offer page that converted

  • description - name of the offer that converted

Page URL Overrides

We are aware that sending the offer URL is not always ideal, especially for sources like Facebook where domain verification is required.

We are working on a page URL override feature that will allow passing a URL to your offer/network, then sending that back in any conversion tracking to tell our system to use a different URL from the offer URL.

Our goal here is allowing you to pass the URL of the initial page the user landed on -- not necessarily a lander, but just the first page from the ad click -- because this has the highest chance of being a page under your control.

We unfortunately can't simply add a new token to postbacks/custom scenarios like {first-page-visited} because its not practical to query a single row in our analytics database for every conversion, to look up a related value. But, we have a solution in mind!

Custom Events

When we add custom events to our system, we would allow you to define different event names to send to TikTok for each of these events. E.g. custom event 1 (alias lead) --> send event name CompleteRegistration, etc.

Did this answer your question?