# TikTok Marketing

> Connect TikTok Marketing to sanda: what to prepare, the fields the connection form asks for, and how its data lands in your warehouse.

## Connect TikTok Marketing

:::steps
1. **Open the catalogue.** In the console, go to **Data · Connections** and press **New connection**.
2. **Choose TikTok Marketing.** It is listed under marketing and analytics; you can also search for it by name.
3. **Fill in the form.** Enter the fields below. Credentials go straight to sanda’s sync engine and are never stored in sanda’s database.
4. **Choose what to sync.** Pick the tables you want, and a sync mode for each. See [choose what to sync](https://docs.sanda-os.com.au/connections/choose-tables).
5. **Run the first sync.** sanda tests the connection, then lands each table you chose in your warehouse.
:::

## Configuration fields

What the connection form asks for. Required fields are marked; the rest are optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Authentication Method** | one of 2 options | No |  |
| **Replication Start Date** | string | No | The Start Date in format: YYYY-MM-DD. Any data before this date will not be replicated. If this parameter is not set, all data will be replicated. Default `2016-09-01`. |
| **End Date** | string | No | The date until which you'd like to replicate data for all incremental streams, in the format YYYY-MM-DD. All data generated between start_date and this date will be replicated. Not setting this option will result in always syncing the data till the current date. |
| **Attribution Window** | integer | No | The attribution window in days. Default `3`. |
| **Daily Reports Date Step** | integer | No | The number of days per API request for daily report streams. Use the default 30 for most accounts. If syncs fail with TikTok API error 40067 ("query too large"), reduce this value (e.g., 7 or 1). Smaller values make more API requests but avoid query size limits for accounts with many ads. Default `30`. |
| **Include Deleted Data in Reports and Ads, Ad Groups and Campaign streams.** | boolean | No | Set to active if you want to include deleted data in report based streams and Ads, Ad Groups and Campaign streams. Default `false`. |

### Authentication Method


Choose one of the following. Each asks for its own fields.

**OAuth2.0**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Access Token** | string, secret | Yes | Long-term Authorized Access Token. |
| **Advertiser ID** | string | No | The Advertiser ID to filter reports and streams. Let this empty to retrieve all. |
| **App ID** | string, secret | Yes | The Developer Application App ID. |
| **Secret** | string, secret | Yes | The Developer Application Secret. |

**Sandbox Access Token**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Access Token** | string, secret | Yes | The long-term authorized access token. |
| **Advertiser ID** | string | Yes | The Advertiser ID which generated for the developer's Sandbox application. |


## Related

:::links
- [Sync modes](https://docs.sanda-os.com.au/connections/sync-modes): How sanda reads each table on every run.
- [Sync schedules](https://docs.sanda-os.com.au/connections/schedules): How often a connection runs.
- [Allowlist sanda’s address](https://docs.sanda-os.com.au/connections/allowlist): For a system behind a firewall.
- [Troubleshoot connections](https://docs.sanda-os.com.au/connections/troubleshooting): What an error means and how to fix it.
:::
