> ## Documentation Index
> Fetch the complete documentation index at: https://docs.segmentstream.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TikTok

> Connect TikTok Ads to SegmentStream and import campaign cost data.

## Getting started

<Steps>
  <Step title="Navigate to Data Sources">
    Inside the admin panel navigate to the **Data Sources** page and click **+ NEW** on the top right corner.
  </Step>

  <Step title="Select TikTok">
    Choose **TikTok** from the list.
  </Step>

  <Step title="Authenticate">
    Click **To continue, authenticate with TikTok** and go through the authentication and setup flow.
  </Step>

  <Step title="Name the data source">
    Name your data source.
  </Step>

  <Step title="Save">
    Click **Save**.
  </Step>
</Steps>

## UTM tagging best practices

Adding a `utm_id` parameter to your tagging template will guarantee improved stitching quality of costs to sessions without altering the rest of your existing UTM tags.

<Steps>
  <Step title="Open URL parameters">
    In the **Destination** section of your ad setup, click on the **Build URL parameters** option.
  </Step>

  <Step title="Add utm_id parameter">
    Click **+ Add**. Enter `utm_id` in the left input field, and `__CAMPAIGN_ID__-__AID__-__CID__` into the right input field.
  </Step>

  <Step title="Apply">
    Click **Apply**.
  </Step>
</Steps>

## Supported dynamic URL parameters

TikTok allows the use of dynamic URL tagging parameters to track campaigns.

SegmentStream supports the following parameters:

| Name                | Description                |
| ------------------- | -------------------------- |
| `__CAMPAIGN_NAME__` | Advertising campaign name. |
| `__CAMPAIGN_ID__`   | Advertising campaign ID.   |
| `__AID_NAME__`      | Ad group name.             |
| `__AID__`           | Ad group ID.               |
| `__CID_NAME__`      | Creative name.             |
| `__CID__`           | Creative ID.               |
