# TikTok Ads

Nimbata's TikTok Ads integration reports calls from your website to TikTok as conversions, through TikTok's Events API, so TikTok can measure and optimize your ads. Each conversion sends a call to one TikTok pixel as the event you choose, and a workflow decides which calls are sent.

**Before you start**

- Permissions: TikTok Ads, under Integrations, in your Nimbata role
- A TikTok ad account with a pixel in TikTok Events Manager.
- The Nimbata tracking code on your website. Only calls from your website are sent, together with the page the caller landed on.
- The **TikTok Ads** tile on your Integrations page. TikTok Ads comes with the same plans as Google Ads. On a plan that does not include it, **Go to integration** offers an upgrade instead.
- The Nimbata project whose calls you want to send: the integration is set up per project.

## Connect TikTok Ads

TikTok Ads has no sign-in. Nimbata sends events with an Events API access token that you generate in TikTok Events Manager.

1. **Open the TikTok Ads integration**

   Go to **Integrations** and click **Go to integration** on the **TikTok Ads** tile (1).

   [The TikTok Ads tile on the Integrations page, with Go to integration marked 1]

   *Open the TikTok Ads tile (1).*

2. **Generate an access token in TikTok**

   In TikTok Events Manager, open your pixel, go to **Settings** and choose **Generate Access Token**. Copy the token. One token covers every pixel of that ad account.

3. **Paste the token in Nimbata**

   Paste the token in **Events API access token** (1) and click outside the field. Nimbata saves it, says "TikTok access token saved." and keeps the token hidden.

   [The TikTok Ads integration in Nimbata, with the Events API access token field under Account Credentials marked 1]

   *Paste the access token in Events API access token (1).*

## Add a conversion

Once the token is saved, the page shows your conversions. Each conversion reports a call to one pixel as one event. To report calls to another pixel, or as another event, click **Add conversion**. Every change saves on its own, and Nimbata says "TikTok Ads settings saved." A conversion with a missing or wrong field is not saved until you fix it.

1. **Enter the pixel code**

   Copy your pixel's code from TikTok Events Manager and enter it in **Pixel code** (1). A pixel code is 10 to 40 letters and digits. The pixel must belong to the ad account of your access token.

2. **Choose the event**

   In **Event** (2), choose the event TikTok records for a call. **Contact** is chosen for a new conversion; **Lead**, **Schedule** and **Submit application** are among TikTok's other standard events in the list.

   To use your own name, choose **Custom event** and type it, such as `QualifiedCall`. A custom name has up to 50 letters, digits or underscores, starts with a letter, and is not the name of a standard event. TikTok reports custom events but cannot optimize campaigns for them.

3. **Choose what is sent**

   - Check **Send call value with the conversion** (3) to send the call's value, with its currency, to TikTok.
   - Check **Also send calls without a TikTok click id** (4) to report calls that were attributed to TikTok but did not come from a TikTok ad click. See [Which calls are sent](#which-calls-are-sent) below.

   [A TikTok Ads conversion with the Pixel code marked 1, the Event Contact marked 2, Send call value with the conversion marked 3 and Also send calls without a TikTok click id marked 4]

   *Enter the Pixel code (1), choose the Event (2), then choose whether to send the call value (3) and calls without a click id (4).*

### Which calls are sent

A workflow decides which calls reach your conversions (see [Send calls with a workflow](#send-calls-with-a-workflow) below). Of those, TikTok receives:

- **Calls from a TikTok ad.** When a visitor reaches your website from a TikTok ad, the page address carries TikTok's click id (`ttclid`), and Nimbata sends it with the call. TikTok matches the call to the ad click.
- **Calls attributed to TikTok without a click id**, but only to a conversion with **Also send calls without a TikTok click id** checked, and only when the call has a caller number. A call is attributed to TikTok when its UTM source names TikTok (such as `tiktok`), when it came through a **Social** tracking source with **TikTok** as its partner, or when the visitor came from tiktok.com. TikTok then matches the call by the caller's number (sent hashed), and the visitor's IP address and browser.

Calls that did not come from your website are not sent, and each call is reported to each conversion once.

## Test the integration

1. **Copy the test code in TikTok**

   In TikTok Events Manager, open the pixel, go to **Test Events** and copy the test code.

2. **Click Test event**

   Back in Nimbata, click **Test event** (1) on the conversion. The button shows once the conversion is saved.

   [A saved TikTok Ads conversion with the Test event button marked 1]

   *Click Test event (1).*

3. **Send the test event**

   Paste the code in **Test event code** (1) and click **Send test event** (2).

   [The Test event dialog with the test code pasted in Test event code, marked 1, and the Send test event button marked 2]

   *Paste the test code (1) and click Send test event (2).*

4. **Find the test call in TikTok**

   Nimbata says "TikTok accepted the test event. It appears in the Test Events tab of the pixel." Open **Test Events** in TikTok Events Manager to see the sample call. A test event is not reported as a conversion.

## Send calls with a workflow

Nothing is sent to TikTok until a workflow sends it. Create a workflow on **Inbound Call** that fires when the **Call Ends**, add a **TikTok Ads** action and choose its conversions, then click **Enable** (1). Each conversion is listed by its event and pixel code, and only the conversions you choose are sent. Add filters before the action to report only some calls, such as calls over a minute long. TikTok Ads is offered in inbound call workflows only.

Detailed guide: [Conversion workflows](https://help.nimbata.com/workflows/conversion-workflows).

[A workflow firing on Inbound Call, Call Ends, with a TikTok Ads action sending the Contact conversion, and the Enable button marked 1]

*The workflow sends every inbound call to the Contact conversion when the call ends. Click Enable (1).*

## Check it worked

The TikTok Ads page now shows **Used in 1 workflow**, and the conversion lists the workflow that sends it. From now on, each call that meets the conditions in [Which calls are sent](#which-calls-are-sent) is reported to TikTok when it ends.

[The TikTok Ads integration used in 1 workflow, with the saved access token and the Contact conversion used by the workflow]

*The page shows Used in 1 workflow, and the conversion lists the workflow that sends it.*

## Troubleshooting

### Nimbata does not accept the access token

- "An access token has no spaces" or "This access token is not valid": copy the token again from TikTok Events Manager, with nothing before or after it, and paste it again.
- "TikTok rejected the access token": generate a new token in TikTok Events Manager and save it in Nimbata.

### The test event fails

- "Paste the test code from the Test Events tab of the pixel": the code is missing or has a character a test code does not have. Copy it again from **Test Events**.
- "This access token cannot send events to that pixel": the pixel belongs to another TikTok ad account. Check the **Pixel code**, or generate a token in the pixel's own ad account.
- "TikTok rejected the test event": check the pixel code and the test code, then try again.
- "TikTok is limiting requests right now" or "TikTok could not be reached": wait a minute and try again.

### There is no Test event button

The conversion is not saved yet. Fix the field marked in red, such as "Enter the pixel code." or "A pixel code is 10 to 40 letters and digits", and the button appears once the conversion saves.

### Calls are not reaching TikTok

- Check that the workflow is enabled and that its **TikTok Ads** action lists the conversion.
- Check that the access token is still saved: without it, no conversion is sent.
- Check that the call came from your website. A call to a number that is not on your website has no landing page, so it is not sent. See [DNI setup](https://help.nimbata.com/tracking/dni-setup).
- For a call without a TikTok click id, check that the conversion has **Also send calls without a TikTok click id** checked, that the call was attributed to TikTok, and that the caller's number was not withheld.
