# TikTok Ads affiliate tracking: capture the ttclid and send sales through the Events API

> Track affiliate sales from TikTok ads: campaign and ad macros, the ttclid, matching sales to clicks, and sending them to TikTok's Events API.

Source: https://hoplytic.com/blog/tiktok-ads-affiliate-tracking · Updated 2026-11-19 · Hoplytic Guides

Video version (53 seconds): [https://hoplytic.com/video/tiktok-ads-affiliate-tracking.mp4](https://hoplytic.com/video/tiktok-ads-affiliate-tracking.mp4)

## Video transcript

How do you track affiliate sales from TikTok ads? Capture the click ID, then send the sale back.

Put your tracking link in the ad. TikTok swaps in the campaign ID on every click, and the ad ID. It adds its click ID, the TTCLID, and your tracker stores it.

In Events Manager, set up a pixel and an Events API token. Give both to your tracker. Each sale goes back as a purchase event with the TTCLID and your commission.

TikTok opens links in its in-app browser, so pixels miss these sales. Server-side reporting doesn't.

Pick TikTok Ads in the link maker, and the macros and TTCLID are handled. Add TikTok under Send back, and each sale goes within about twenty seconds.

The full guide is right below. Hoplytic: ad tracking made simple.

## Key points

- TikTok adds the ttclid to ad clicks; your tracker should store it with each click.
- Add __CAMPAIGN_ID__ and __CID__ (ad ID) to the destination URL to know which campaign and ad each sale came from.
- Report affiliate sales to TikTok's Events API with the ttclid, so its bidding optimises for buyers, not clickers.
- TikTok opens links in its in-app browser, which is another reason browser pixels miss affiliate sales.

TikTok traffic is cheap and fast to test, but its algorithm needs conversion signals to find buyers. With affiliate offers it never sees the sale unless you report it.

**Short answer:** put your tracking link in the ad with `__CAMPAIGN_ID__` and `__CID__` for campaign and ad. TikTok adds its click ID (`ttclid`), which your tracker stores. When the network reports the sale, the tracker sends it to TikTok's Events API with that ttclid and your commission as the value.

## The URL

`https://go.yoursite.com/offer?campaign=__CAMPAIGN_ID__&ad=__CID__`

TikTok replaces the macros on each click and appends `ttclid`. Your tracker stores all three with the click and passes its own click ID to the affiliate network. See [TikTok Ads macros](https://hoplytic.com/blog/tiktok-ads-macros) for the full list.

## Reporting sales to TikTok

- In TikTok Events Manager, set up a web event source (pixel) and generate an Events API access token.

- Give your tracker the pixel ID and the token.

- For each affiliate sale whose click has a ttclid, the tracker sends a purchase event with the ttclid, event time, value and currency.

- Use that event as the optimisation goal once it has enough volume.

## Things that go wrong

- **No ttclid on clicks:** check the ad uses your full tracking link, and that nothing in the chain drops the query string.

- **Events received but not attributed:** the sale came too long after the click for TikTok's attribution window, or the event was sent without the ttclid.

- **Different numbers in TikTok and your network:** normal. TikTok counts by its own windows and model; the network decides what's paid.

- **In-app browser:** visitors who come back later in their normal browser have no cookie there, which is why server-side reporting matters.

## Getting cost in

TikTok doesn't pass the cost of each click in the URL. Enter your daily spend from Ads Manager on the tracking link and your tracker spreads it over that day's clicks, giving cost, profit and ROAS per campaign and ad. See [ROAS tracking](https://hoplytic.com/blog/affiliate-roas-tracking).

## On Hoplytic

Pick TikTok Ads in the link maker: the campaign and ad macros are added and the ttclid is stored automatically. Add TikTok under **Send back** with your pixel ID and access token, and each sale is sent within about 20 seconds of the network reporting it, retried for up to 12 hours if TikTok is unavailable.

![Setting up Send back in Hoplytic: choose the ad platform, follow the steps shown for it, pick when each sale is sent and what value is reported.](https://hoplytic.com/video/howto-send-back.gif)

*Choose the ad platform, then when to send each sale and its value.*

## Questions people ask

### Can I put the TikTok pixel on an affiliate offer?

Not on the merchant's thank-you page. Instead, your tracker learns about the sale from the network and sends it to TikTok's Events API with the ttclid from the original click.

### What do I need for the Events API?

A pixel (event source) ID and an access token from TikTok Events Manager. The tracker sends each purchase with the ttclid, the time and the value.

### Does TikTok allow affiliate links in ads?

TikTok reviews the landing page and has rules on misleading claims and certain product categories. Many affiliates send ads to their own landing page first. Check TikTok's advertising policies and the offer's terms.
