This feature is in BETA version. For more information, contact your Customer Success Representative.
Many businesses are increasingly adopting TikTok as a key component of their advertising strategy. With over a billion active users, TikTok offers a vast audience and a unique, creative platform for brand promotion. Integrating event data with TikTok’s Events API can significantly enhance a brand’s advertising effectiveness and scale on the platform.
The native Tiktok Events Export connector for exporting event data to the TikTok Events API simplifies syncing event data to the TikTok Events Manager, driving data-driven audience targeting, and real-time insights for optimization.
This connector provides versatile data sync capabilities:
- Website Event Data:
- Enrich your website pixel data with server-side data.
- Achieve more accurate audience targeting, enhancing your campaign’s effectiveness.
- App Event Data:
- Sync app event data with server-side data.
- Improve targeting accuracy and optimize your campaign strategies for better results.
- Offline Conversion Data:
- Send offline conversion data, such as physical store visits, to the TikTok Events API.
- Track and measure the impact of online ads on offline sales, allowing for more informed campaign adjustments.
- CRM Lead Conversion Data:
- Export CRM lead conversion data to TikTok Events API.
- Enhance B2B lead generation campaigns by targeting users who have shown interest in your products or services, optimizing ad spend for higher quality leads.
- Data Validation:
- Ensure all event data is accurately formatted and validated according to TikTok’s specifications.
- Streamline the data integration process, reducing the risk of errors and ensuring smooth data sync operations.
- Basic knowledge of Treasure Data, including the TD Toolbelt.
- Basic knowledge of TikTok Business.
- TikTok Access Token or TikTok Business account.
- This connector can support creating new event source for Web Events and Offline Event source type only.
- Experimental Event Source Types: App Event and CRM Event source types are experimental and not fully supported, as TD cannot enable these event sources for our test accounts. Please report any issues encountered with these event source types so that TD can address and fix them.
If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection.
Please find the complete list of static IP addresses, organized by region, at the following link:
https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/
Before running your query, you must create and configure the data connection in Treasure Data. As part of the data connection, you provide authentication to access the integration.
Your first step is to create a new authentication with a set of credentials.
- Select Integrations Hub.
- Select Catalog.

- Search for your Integration in the Catalog; hover over the icon and select Create Authentication.

- Ensure that the Credentials tab is selected, and then enter credential information for the integration. Choose one of the following:
- OAuth Authentication Workflow
Select the link "Click here" to start the OAuth authentication flow. After completing the authentication, a new OAuth connection will be created and available in the dropdown box

Select Continue to create a new connection.
- Access Token Workflow
Obtain the access token from the TikTok Events Manager and input it in the TikTok Access Token field.

New Authentication Fields
| Parameter | Description |
|---|---|
| auth_method | Authentication method. Supported values: - oauth: OAuth authentication - access_token: Long live access token generated in the TikTok Event Manager. |
| access_token | You can obtain the TikTok Access Token from the TikTok Event Manager. This parameter is only available for access token authentication methods. |
- Select Continue.
- Enter a name for your authentication, and select Done.
- Navigate to Data Workbench > Queries.
- Select New Query.
- Run the query to validate the result set.

- Select Export Results.

You can select an existing authentication or create a new authentication for the external service to be used for output. Choose one of the following:
- Use Existing Integration

- Create a New Integration
The connection does not support creating a new connection in the result export. So, you need to have already created the connection.
- Specifying the target event source in the Tiktok Event Managers for upload event data.

| Field | Description |
|---|---|
| Specify Event Data Source Type | Select the type of TikTok event data source you are using. Supported event source types include:
|
| Specify The Target Event Source, Event Source ID, Event Source Name, Advertiser ID | Select the specific event source to upload event data to. The method you choose depends on the authentication method you use. Supported methods include:
|
Other configuration options for data sync operations:

Field Description Test Event Code The TikTok Test Event Code for debug purposes. Thread Count Number Number of parallel requests to TikTok Events. Min: 1, Max: 10, Default: 5. Enabled Limited Data Processing The boolean value to enable/disable a limited data processing option. See Events API 2.0 - Limited Data Use for more details Skip on invalid record? The flag to continue or stop the job when the job handles an invalid record.
- You can create an activation in the Audience Studio to export segment data to this integration.
- You can use Scheduled Job with Result Export to periodically upload data to a target destination.
You can also use CLI(Toolbelt) to export results to TikTok Events.
You need to specify the information for export to your SFTP server as *--result option of td query* command. About td query command, you can refer to this article.
The format of the option is JSON and the general structure is as follows.
{
"type": "tiktok_events",
"auth_method": "oauth",
"access_token": "78cdexxxen",
"event_data_source": "WEB",
"target_event_source_method": "NAME",
"event_source_name": "Test",
"advertiser_id": "7373xxx",
"event_source_id": "CPUI2xxx",
"test_event_code": "TESTXXX",
"thread_count": 5,
"limited_data_use": true,
"skip_invalid_record": true
}| Name | Description | Value | Default Value | Required |
|---|---|---|---|---|
| type | Describe the name of the service as the destination of export. | tiktok_events | N/A | Yes |
| auth_method | Authentication method | Supported values:
| oauth | Yes |
| access_token | TikTok access token generated from oauth flow or obtained from Events Manager. | N/A | N/A | Yes |
| event_data_source | TikTok event data sources. | Supported event sources:
| WEB | Yes |
| target_event_source | The target event source method. | Supported values: - ID - NAME - NEW | ID | Yes |
| event_source_name | The name of the event source. Input this field when the value of target_event_source is NAME or NEW | N/A | N/A | Yes, if the value of target_event_source is NAME or NEW |
| advertiser_id | The advertiser ID value. Input this field when the value of target_event_source is NAME or NEW | N/A | N/A | Yes, if the value of target_event_source is NAME or NEW |
| event_source_id | The event source id. Input this field when the value of target_event_source is ID |
| N/A | Yes, if the value of target_event_source is ID |
| test_event_code | The TikTok test event code. | N/A | N/A | No |
| thread_count | The number of parallel requests to TikTok Events API. | N/A | 5 | Yes |
| limited_data_use | The limited data use flag. | true/false | false | No |
| skip_invalid_record | The flag to continue or stop the job when handling the invalid record. | true/false | false | No |
OAuth authentication
td query \
--result '{
"type": "tiktok_events",
"auth_method": "oauth",
"access_token": "373xxx",
"event_data_source": "WEB",
"target_event_source_method": "NAME",
"event_source_name": "Test",
"advertiser_id": "737xxx",
"event_source_id": "738xxx",
"thread_count": 5,
"limited_data_use": false,
"skip_invalid_record": false
}' \
-d sample_datasets \
"SELECT * FROM www_access" \
-T prestoAccess token authentication
td query \
--result '{
"type": "tiktok_events",
"auth_method": "access_token",
"access_token": "373xxx",
"event_data_source": "WEB",
"target_event_source_method": "ID",
"event_source_name": "Test",
"advertiser_id": "737xxx",
"event_source_id": "738xxx",
"thread_count": 5,
"limited_data_use": false,
"skip_invalid_record": false
}' \
-d sample_datasets \
"SELECT * FROM www_access" \
-T presto