# TikTok Ads

> Connect TikTok Ads to AnyTrack and send conversions through the TikTok Conversion API. Get accurate attribution and real-time optimization signals across affiliate, eCommerce, and lead generation campaigns.

The TikTok Ads integration lets AnyTrack send conversions to the [TikTok Conversion API](https://ads.tiktok.com/help/article/events-api?lang=en) so you can optimize campaigns, build audiences, and report on attributed revenue. AnyTrack handles event mapping, deduplication, and PII hashing automatically.

<Prerequisites
  title="Before you begin"
  items={[
    { label: "You have an active AnyTrack account on a Starter, Personal, or Advance plan", done: true },
    { label: "You have an active TikTok Ads account", done: true },
    { label: "The AnyTrack Tracking Tag is installed on your website", done: true }
  ]}
/>

> ❗ **Important**
>
> Remove any existing TikTok pixel installed via Shopify, Google Tag Manager, or theme code before completing the setup. AnyTrack loads the TikTok Tracking Tag with [deduplication](/docs/deduplication) parameters automatically — duplicate installations break dedup and can double-count conversions.

## Step 1: Connect AnyTrack with TikTok

From the AnyTrack Dashboard:

1. **Open Tracking Tags** — Click **Tracking Tags**, then **TikTok**.
2. **Authorize** — Click **Browse** to open the TikTok authentication window, then click **Authorize the AnyTrack App**.
3. **Confirm redirect** — You return to the AnyTrack Dashboard with the TikTok connection live.
4. **Enable the TikTok Conversion API** — Toggle it on in the TikTok pixel settings.
5. **Save** your settings.

## Step 2: Configure Event Mapping

Conversions tracked by AnyTrack are mapped to [TikTok standard events](https://ads.tiktok.com/help/article/standard-events-parameters?lang=en#anchor-1). Default mappings cover the standard funnel events — review them and adjust if your funnel needs custom mapping.

<Image align="center" className="border" border={true} alt="TikTok Conversion API event mapping in the AnyTrack Dashboard" src={readmeAsset1} />

## Step 3: Update Your TikTok Pixel Settings

In TikTok Ads Manager:

1. Allow first-party cookies on the pixel.
2. Enable Automatic Advanced Matching.

Both settings improve Event Match Quality when AnyTrack sends conversions.

## Step 4: Verify Your Setup

You can send test events to the TikTok Conversion API and confirm they arrive on TikTok's side:

1. **In TikTok**, open the **Test Event** tab and copy the Test Event ID. Keep the tab open.
2. **In AnyTrack**, open the TikTok pixel settings and paste the Test Event ID into the test field.
3. Click **TEST**.

Test events appear in TikTok's Test Event tab within a few seconds.

<Image align="center" className="border" border={true} alt="TikTok Test Event tab showing AnyTrack-sent events" src={readmeAsset2} />

## Step 5: Add the TikTok UTM Template to Your Ads

Unlike Facebook Ads or Google Ads, TikTok does not auto-append UTM parameters. Add the [UTM tracking template](/docs/tiktok-utm) manually so AnyTrack can attribute traffic to the right campaigns.

Copy the template from **Tracking Tags → TikTok Tracking Tag → Ads Integration tab**. In TikTok Ads Manager, go to **Ad → Ad details** and paste the URL with the appended UTM template.

Example template:

```http tiktok utm tracking template
https://www.example.com/?utm_source=tiktok&utm_medium=cpc&utm_campaign=__CAMPAIGN_NAME__&utm_id=__CAMPAIGN_ID__&utm_term=__CID_NAME__&utm_content=__AID_NAME__&ad_id=__CID__&ad_placement=__PLACEMENT__&adset_id=__AID__&ad_site=__CSITE__&ad_type=__CTYPE__
```

Save your changes in TikTok, then return to the **Ads Integration** tab in AnyTrack and click **Verify Ads Settings** (or **Reload** if you ran verification earlier). Ads with the correct template show a green indicator and attribute correctly.

## How the TikTok Conversion API Works

TikTok's Conversion API (also called the Events API) accepts conversion events directly from your server, complementing the browser-loaded TikTok Pixel. Server-side delivery bypasses ad blockers, ITP cookie expiry, and abandoned page loads. The conversion reaches TikTok even when the browser cannot fire the pixel.

AnyTrack runs the full Conversion API pipeline so you do not need to manage authentication, retries, or field mapping:

- **Authentication** — AnyTrack generates and rotates the TikTok Access Token when you authorize your TikTok account.
- **Event mapping** — AnyTrack maps every AnyTrack event to the matching TikTok standard event and forwards it via the Conversion API endpoint.
- **PII hashing** — Customer email and phone are hashed with SHA-256 before they reach TikTok. AnyTrack handles lowercase normalization and trimming automatically.
- **Click ID forwarding** — The `ttclid` (TikTok Click ID) captured at landing is attached to every conversion so TikTok attributes it to the original ad click.
- **Deduplication** — AnyTrack tags every conversion with a shared `event_id` so TikTok deduplicates the browser pixel event and the server-side event when both fire.

For the full server-side architecture and how it applies across every ad platform, see [Server-Side Tracking](/docs/server-side-tracking).

## Server-Side vs Browser-Side Tracking on TikTok

TikTok provides two complementary tracking layers:

| | TikTok Pixel (Browser) | TikTok Conversion API (Server) |
|---|---|---|
| **Where it runs** | Visitor browser | AnyTrack server |
| **Blocked by ad blockers** | Yes | No |
| **Blocked by ITP / cookie expiry** | Yes | No |
| **Captures `ttclid`** | Yes (from URL) | Yes (forwarded by AnyTrack) |
| **Hashes PII** | No | Yes (SHA-256) |
| **Real-time delivery** | Yes | Yes |

The recommended setup is **hybrid**: both layers active simultaneously, with a shared `event_id` so TikTok deduplicates the matched pair. AnyTrack ships hybrid by default. Connect your TikTok account and AnyTrack loads the pixel and starts server-side delivery on the same day.

If you previously installed the TikTok Pixel manually or through Shopify's TikTok app, remove that installation. The pixel AnyTrack loads carries the deduplication parameters; a second manually-installed pixel inflates event counts in TikTok Events Manager.

## TikTok Integration Features

- **No-code authentication** — Connect through standard TikTok OAuth in one click.
- **Conversion API and Tracking Tag** — AnyTrack sends conversions through both channels with automatic deduplication.
- **PII hashing** — Customer emails and phone numbers are hashed with SHA-256 before reaching TikTok.
- **eCommerce conversion data** — Itemized orders with product IDs, names, prices, quantities, and brand names.
- **Affiliate conversion data** — Standard affiliate conversion mapping out of the box.
- **Lead generation events** — Track `FormSubmit`, `Lead`, and `CompleteRegistration` conversions.
- **UTM tracking template** — Pre-built template with dynamic campaign placeholders.
- **Campaign reports** — Attributed conversions, revenue, and ROAS in the AnyTrack Campaign Report.
- **Custom audience signals** — Conversion data feeds TikTok audience building automatically.
- **Budget management** — Adjust TikTok campaign budgets from the AnyTrack Dashboard.

## Related Resources

- [TikTok UTM tracking template](/docs/tiktok-utm)
- [Install AnyTrack Tag](/docs/install-anytrack-tag)
- [Shopify and TikTok Ads](/docs/shopify-and-tiktok-ads-integration)
- [Server-Side Tracking](/docs/server-side-tracking)
- [Event deduplication](/docs/deduplication)
- [AnyTrack attribution explained](/docs/anytrack-attribution-explained)

<FaqAccordion
  title="FAQ and Troubleshooting"
  icon="fa-duotone fa-circle-question"
  items={[
    {
      question: "How long does it take to see conversions in TikTok Ads Manager?",
      answer: "TikTok processes Conversion API events within 2 hours under normal conditions. New pixels can take up to 12 hours due to SDK cache, and iOS attribution can take up to 72 hours. AnyTrack shows conversions in near real-time regardless of TikTok's processing schedule."
    },
    {
      question: "Do I need to generate an Access Token?",
      answer: "No. AnyTrack generates and stores the Access Token automatically when you authenticate TikTok during setup."
    },
    {
      question: "How does AnyTrack send matching parameters to TikTok?",
      answer: "AnyTrack collects matching parameters automatically — email, phone, name, and other customer traits from direct integrations like Shopify or ClickFunnels, and anonymous first-party data for affiliate marketing. All PII is hashed with SHA-256 before it reaches TikTok."
    },
    {
      question: "Does the integration support affiliate marketers?",
      answer: "Yes. AnyTrack tracks and sends all standard affiliate conversions to TikTok Ads, with matching parameters built from anonymous first-party data."
    },
    {
      question: "Do I need to install the TikTok Tracking Tag manually?",
      answer: "No. AnyTrack loads the TikTok Tracking Tag automatically when you connect TikTok, including on Shopify stores. Remove any standalone TikTok pixel from your site to avoid duplicates."
    },
    {
      question: "How do I verify conversions are reaching TikTok?",
      answer: "Open the TikTok Web Diagnostics tab in TikTok Ads Manager to inspect event data in real time. You can also use the Test Event flow described in Step 4."
    }
  ]}
/>
