TikTok Conversions API integration

  • The TikTok API integration allows you to pass conversion details from CPV Lab Pro to TikTok and see them directly in your TikTok Ads Manager account.
  • This is very important for the optimization and delivery of your ads through TikTok because it allows TikTok to see how your ads performed for specific audiences.

Pre-requirements

  • CPV Lab Pro Version 9.0
  • A TikTok Ads Manager account
  • At least one active campaign on TikTok

Campaign Setup in CPV Lab Pro for TikTok

Setting up a campaign for TikTok can be done in the same way as for any other traffic source. Here are the steps required.

1. Import the TikTok Traffic Source (if you don’t have it already in your tracker)

  • Access the Traffic Sources page and import TikTok from the Catalog of networks

import TikTok traffic source

2. Choose TikTok as the traffic source for your campaign.

  • You will get the available tokens pre-filled. The important token here is External ID Token because this will contain a unique code for each visitor.
  • Choose as extra tokens the metrics that you want to see in reports from the ones available in the dropdowns.

 TikTok tokens

3. Choose the Data Options that you want to capture in your campaign.

  • It is very important to select the User Agents Data Options as this is needed in order to pass conversions back to TikTok.
  • Also make sure that you have the IP address capturing checked.

 TikTok data options

4. Define the landing pages and offers for your campaign.

  • Define the landing pages and offers for your campaign

    • you can use from the predefined landing pages or offers OR
    • you can add new ones directly in the campaign
  • Add the Step 2 code provided in the campaign setup page and add it in your landing pages, just before the closing </body> tag.

 TikTok step2 code

5. Take the provided Campaign URL (base.php page) and use it as the URL of the ads defined in TikTok.

 TikTok step2 code

  • Notice that the Campaign URL contains the __CLICKID__ macro which will be replaced by TikTok with a unique code for each visitor

Note: TikTok accepts both Campaign URL tracking and Direct Traffic Code tracking, so you can use any of the 2 tracking methods. This guide uses the Campaign URL tracking method.

Campaign setup in TikTok

  • Create your campaign, ad groups and ads in TikTok using the TikTok Ads Manager interface.
  • When creating an ad in TikTok, use the Campaign URL as the Destination URL, like this:

 TikTok destination url

  • The Campaign URL will contain all the tokens accepted by TikTok that you have configured to be captured in Extra Tokens.

Setup the TikTok API integration to pass conversions

1. Create a TikTok Pixel (if not already created)

 TikTok API manage web events

  • Select “Set Up Web Events”, then choose “Events API” to create a new pixel

 TikTok API setup web event

  • Enter a name for the Pixel, then choose “Manually Set Up Events API”.

 TikTok API pixel name

  • Choose Next from the bottom of the page and your pixel is setup.

2. Get the Pixel ID

  • Check the Pixel details page for the Pixel ID. This appears after the “ID:” text.
  • Save this Pixel ID as it will be needed later.

 TikTok API get pixel id

3. Generate the Access Token

  • Also in the Pixel details page, look for the Settings tab, then select the “Generate Access Token” button.
  • Save the Access Token value somewhere safe as this won’t be displayed again and it isn’t stored by TikTok.

 TikTok API access token

4. Go back to the campaign setup page in CPV Lab Pro to finish the TikTok API configuration

  • Go to your TikTok Campaign in CPV Lab Pro

  • Look for the new TikTok specific section in the "Tracking Pixel" area of the campaign setup page. Here is where you need to add the TikTok API details:

    • API Access Token – the access token generated above
    • Pixel ID – the ID of your TikTok Pixel created above
    • Event Name – the name of the event you want to pass to TikTok for each conversion. The default name is CompletePayment
    • Amount – the revenue that you want to pass to TikTok.
      • The default value of the {!revenue!} placeholder which will be replaced by the actual revenue.
      • You can also set a fixed numeric value:
    • Currency – the currency for your revenue (3-letter ISO code). The default option is USD. Tiktok API currency setup
  • Save the campaign setup page and the integration with TikTok API for this campaign is complete.

Check that conversions get reported

  • Once the above things are implemented, CPV Lab Pro will automatically send conversion details to TikTok each time the Postback URL gets fired from the Affiliate Network in your campaign.
  • After receiving a few new conversions in your campaign, you should make sure that these were posted to TikTok by looking in 3 places:
      1. In the Conversions Log page from CPV Lab Pro - you will see a record starting with "type":"tiktokapi and with the details posted to TikTok for each TikTok API call and with “message”:”OK” in the ClickID column, something like in the image below Tiktok API check conversions
      1. In TikTok, in the Overview tab from the Pixel details page - you should see the number of CompletePayment events received and also the last time an event was received,like in the image below Tiktok API overview tab
      1. In the reports from your TikTok Ads Manager account - You will see conversions appearing here also; For complete details in these reports, choose the Custom Columns option and select the Page Event columns as shown below Tiktok API custom columns

Final Notes

  • The TikTok campaigns are setup in CPV Lab Pro similar to campaigns from other traffic sources with only these changes:
    • The Traffic Source for your campaign should be “TikTok” (imported from the Catalog) and the External ID token should be configured for the “__CLICKID__” macro
    • The TikTok API configuration (Pixel ID and Access Token) needs to be performed in order to pass conversion details back to TikTok
    • Make sure that you have checked the options to capture the User Agents and IP Addresses from your visitors

There may be a small delay (up to 15 minutes) between the moment conversions are passed from CPV Lab Pro to the TikTok API and the moment that they appear in the Pixel details page from TikTok Ads Manager. This is normal and doesn’t affect tracking.

Last Updated: 3/24/2022, 12:09:14 AM