# Setup Guide

This guide will help you set up TikTok Ads as a destination in the RudderStack dashboard. It also lists the configuration settings required to correctly send data from the supported sources to TikTok Ads.

## Connection compatibility

{{< destination-config >}}

{{< info >}}
In the web device mode integration, that is, using [JavaScript SDK]({{< ref "sources/event-streams/sdks/rudderstack-javascript-sdk/_index.md" >}}) as a source, RudderStack loads the TikTok Ads native SDK from the `https://analytics.tiktok.com` domain. Based on your website's content security policy, you might need to [allowlist this domain]({{< ref "sources/event-streams/sdks/rudderstack-javascript-sdk/load-js-sdk.md#allowlist-destination-domain" >}}) to load the TikTok Ads SDK successfully.
{{< /info >}}

## Setup

In your [RudderStack dashboard](https://app.rudderstack.com/), add a source. Then, from the list of destinations, select **TikTok Ads**.

### Connection settings

| Setting | Description |
| :----| :-----|
| Event version to use | Select the TikTok Ads Events API version to use from the dropdown.<br /><br />{{< warning >}}RudderStack recommends using the [Events 2.0 API](https://business-api.tiktok.com/portal/docs?id=1771101276978178) to send your events as [Events 1.0 API will be sunset](https://business-api.tiktok.com/portal/docs?id=1739657891856385) by the second half of 2024.{{< /warning >}} |
| Access Token | Enter the access token (also called long-term access token). You can generate it by following the steps mentioned in [Authorization](https://ads.tiktok.com/marketing_api/docs?id=1701890912382977) and [Authentication](https://ads.tiktok.com/marketing_api/docs?id=1701890914536450) topics of the TikTok documentation. |
| Pixel Code | Enter the TikTok Ads pixel code. See [TikTok documentation](https://ads.tiktok.com/gateway/docs/index?identify_key=2b9b4278e47b275f36e7c39a4af4ba067d088e031d5f5fe45d381559ac89ba48&language=ENGLISH&doc_id=1701890979375106#item-link-Where%20to%20Find%20pixel_code) for more information on obtaining the pixel code. |
| Hash Contextual User Properties (SHA-256) | If this setting is turned on, RudderStack hashes the contextual user properties like `external_id`, `email`, `phone_number` in the SHA-256 format. |

### Event settings

{{< warning >}}
Note the following before configuring the event mappings in the RudderStack dashboard:

- You must [create the standard events in Events Manager](https://ads.tiktok.com/help/article/standard-events-parameters?lang=en#anchor-1) along with the required fields. Otherwise, RudderStack will send the events but they will not be visible in your TikTok dashboard.
- Before sending the event properties, make sure they are configured for the respective standard events in your TikTok dashboard, otherwise they will be discarded.
{{< /warning >}}

| Setting | Description |
| :----| :-----|
| Mapping to trigger the TikTok Ads standard events for the respective events | Enter the event name and select the corresponding [TikTok Ads standard event](https://ads.tiktok.com/help/article?aid=10028) to be triggered when that event is called. You can specify multiple **Standard Events** for one **Event Name** and vice versa. |
| Send custom events | Turn on this setting to send custom events to TikTok Ads.<br /><br />Note that:<br /><br /><ul><li>To send custom events to TikTok Ads using [RudderStack Open Source](https://app.rudderstack.com/signup?type=opensource), you should be using [`rudder-transformer`](https://github.com/rudderlabs/rudder-transformer) v1.52.0 or later.</li><li>For custom events, RudderStack maps only the [standard fields](https://github.com/rudderlabs/rudder-transformer/blob/0e1429663d167a2c5cded0d9130374eb586a18c0/src/v0/destinations/tiktok_ads/data/TikTokTrack.json) supported by TikTok Ads and drops all other fields in the event. See [TikTok Ads standard fields](https://business-api.tiktok.com/portal/docs?id=1741601162187777) documentation for more information.</li></ul> |

Note that RudderStack supports the following TikTok [standard events](https://ads.tiktok.com/help/article/standard-events-parameters?lang=en):

{{< details "**List of supported TikTok standard events**" >}}
<br/>

- `Add Payment Info`
- `Add to Cart`
- `Add to Wishlist`
- `Application Approval`
- `Click Button`
- `Complete Payment`
- `Complete Registration`
- `Contact`
- `Customize Product`
- `Download`
- `Find Location`
- `Initiate Checkout`
- `Lead`
- `Place an Order`
- `Purchase`
- `Schedule`
- `Search`
- `Submit Application`
- `Submit Form`
- `Subscribe`
- `Start Trial`
- `View Content`
{{< /details >}}
<br />

{{< warning >}}
TikTok has recently updated the following standard events:

- `Submit Form` is renamed to `Lead`.
- `Complete Payment` is renamed to `Purchase`.

Although TikTok still supports the old events (`Submit Form` and `Complete Payment`), RudderStack recommends using the new events (`Lead` and `Purchase`) to avoid any issues.
{{< /warning >}}

### Event filtering settings

| Setting | Description |
| :----| :-----|
| Client-side Events Filtering | This setting lets you specify which events should be blocked or allowed to flow through to TikTok Ads when sending events via [device mode]({{< ref "destinations/rudderstack-connection-modes.md#device-mode" >}}). For more information on this setting, see [Client-side Events Filtering]({{< ref "sources/event-streams/sdks/event-filtering.md" >}}). |

### Web device mode settings

| Setting | Description |
| :----| :-----|
| Use device mode to send events | Turn on this setting to send events from the JavaScript SDK to Tiktok Ads via [device mode]({{< ref "destinations/rudderstack-connection-modes.md#device-mode" >}}). |
| Consent management settings | Configure the consent management settings for the specified source by choosing the **Consent management provider** from the dropdown and entering the relevant consent category IDs. See [Consent Management in RudderStack]({{< ref "data-governance/consent-management/overview.md" >}}) for more information on this feature. |

## FAQ 

#### How do I create a pixel in TikTok Ads?

See [TikTok documentation](https://ads.tiktok.com/help/article/get-started-pixel?lang=en) for detailed steps on creating a pixel.

#### How can I verify if my data is delivered to TikTok successfully?

You can use this [Google Chrome extension](https://chrome.google.com/webstore/detail/tiktok-pixel-helper/aelgobmabdmlfmiblddjfnjodalhidnn) to troubleshoot your Pixel installation for any errors and verify if your events are delivered to TikTok.
