ttclid is the TikTok Click ID: a unique value TikTok adds to your landing page URL as ttclid=… when someone clicks your ad. Keep it with the visit, send it back with the purchase through the TikTok pixel or the Events API, and TikTok can match the sale to that exact click.
If you run TikTok traffic to your own pages, the ttclid is the one parameter I'd make sure survives every redirect between the ad and the checkout.
Picture a TikTok campaign where Ads Manager reports 12 purchases for the week and your store reports 40 from the same traffic. Nobody is lying. TikTok can only count the sales it can tie back to a click, and the thing that ties them is a string of characters that most funnels drop somewhere between the ad and the thank-you page.
I spent nine years as CTO of a direct-response company, and "the platform shows fewer sales than we made" was a recurring ticket. It almost never turned out to be the ad platform's fault. It was usually a redirect, a checkout on another domain or a form that didn't pass the click ID along. This guide is about that string for TikTok: what it is, where it breaks and how to get it back to TikTok.
What is ttclid?
TikTok describes it as "a tracking parameter appended to a landing page URL when you click on an ad on TikTok" (TikTok Business Help Center). Every click gets its own value, so the URL your visitor lands on looks like this:
https://yourbrand.com/offer?utm_source=tiktok&utm_campaign=spring&ttclid=E.C.P.CsABv3fQ2RHa...
The UTM parameters say which campaign the visit came from, and you set them yourself. The ttclid says which click it was, and TikTok sets it. That difference matters later. UTMs are good for your own reports; only the ttclid lets TikTok connect a purchase on your site back to the person who saw and tapped the ad, which is what its bidding learns from.
Two practical details from TikTok's developer docs: a ttclid can be up to 1,000 characters long, so don't cut it short in a database column, and TikTok recommends holding on to it for the visitor's whole session so every event you send can carry it (TikTok API for Business).
When and where TikTok adds the ttclid
TikTok adds the ttclid when someone clicks your ad and lands on your website. You don't have to build it into the destination URL. Older setups added ttclid=__CLICKID__ to the URL by hand; if yours still does, open a real ad click and check that the landing URL ends up with one ttclid value, not two.
What happens next depends on your page. If the TikTok pixel is installed, it reads the ttclid from the URL and stores it in a first-party cookie called ttclid on your domain. First-party cookies are on by default and can be turned off in the pixel settings; TikTok's cookies expire 13 months after they are set or last used (TikTok, cookies with the pixel). Without the pixel, nothing stores it unless your own code or platform does.

How long a ttclid lasts
The cookie can sit in a browser for months, but that isn't how long the click counts. TikTok counts a click only inside its click-through attribution (CTA) window: each click ID "adheres to the same CTA window configured in Attribution Manager". A purchase you report after the window closes won't be credited to that click.
| Setting | Default for pixel and Events API | Options |
|---|---|---|
| Click-through window | 7 days after the click | 1, 7, 14 or 28 days |
| View-through window | 1 day after the view | Off, 1 or 7 days |
Source: TikTok's announcement of flexible attribution windows (TikTok for Business). Check the current setting in your own Attribution Manager before you compare TikTok's numbers with your store's. When I see two reports that disagree, the window is the first thing I check, because a 7-day window against a store report covering 30 days will never match, however good the tracking is.
Why the ttclid gets lost
The ttclid only exists in the first URL. Every hop after that is a chance to lose it, and none of them throw an error. The sale still happens; TikTok just never hears about it.
- Redirects that rebuild the URL. A link shortener, a tracker redirect, or a server rule that sends
httptohttpsor the bare domain towwwwithout keeping the query string. The visitor arrives, the ttclid doesn't. - Parameters stripped on purpose. "Clean URL" plugins, some caching and CDN rules, and scripts that tidy the address bar. TikTok itself says you may remove the parameter from your URLs; do it only after it has been stored.
- A checkout on another domain. A cookie set on
yourbrand.comcan't be read oncheckout.someprovider.com. Unless you pass the ttclid in the link to the checkout or keep it on your server, the purchase happens where the click ID isn't. - The in-app browser. TikTok opens ad links in its own browser. If the visitor switches to Safari or Chrome to buy, the cookies set in the in-app browser stay behind.
- Safari's tracking prevention. Safari limits how long cookies set by scripts can live, down to one day after some link-decorated arrivals (WebKit, ITP 2.2), and in Private Browsing it removes known tracking parameters from links (WebKit, Safari 17). Browser-only tracking loses more on iPhone traffic, which on TikTok is a lot of the traffic.
- Consent and ad blockers. If the pixel doesn't load, it doesn't store the ttclid or send the purchase.

The quickest test I know: click one of your own live ads, then walk to the order form and look at the URL and the cookies at each step. If the ttclid disappears at step two, no amount of dashboard work will bring it back.
How to capture ttclid and send it back
The fix is the same on every stack: read the ttclid on the first page, keep it somewhere you control, and send it with the conversion from your server.
- Read it on arrival. Take
ttclidfrom the landing URL on the first page view, before any redirect or script can remove it. - Store it first-party. Best: on your server, with the visit or session record. Good: a cookie or local storage on your own domain. For lead forms, a hidden field that fills from the cookie.
- Carry it across domains. If the checkout is on another domain, add the ttclid to the checkout link, or look it up on your server from the session when the order comes in.
- Send the purchase with it. Send the conversion through the TikTok Events API with the ttclid in
user.ttclid, plus the event name, anevent_id, the value, the currency, and whatever matching data you have (hashed email, IP address, user agent). - Test before you trust it. Use the test events view in TikTok Events Manager and place a test order from a real ad click.
A minimal capture script, for pages you control:
<script>
var t = new URLSearchParams(location.search).get('ttclid');
if (t) document.cookie = 'ef_ttclid=' + encodeURIComponent(t) +
'; path=/; max-age=' + 60 * 60 * 24 * 28 + '; SameSite=Lax; Secure';
</script>
And the shape of a purchase sent to the Events API (POST https://business-api.tiktok.com/open_api/v1.3/event/track/ with your access token in the Access-Token header):
{
"event_source": "web",
"event_source_id": "YOUR_PIXEL_ID",
"data": [{
"event": "CompletePayment",
"event_time": 1759140000,
"event_id": "order-1042",
"user": {
"ttclid": "E.C.P.CsABv3fQ2RHa...",
"email": "sha256 of the lowercased email",
"ip": "203.0.113.7",
"user_agent": "Mozilla/5.0 ..."
},
"page": { "url": "https://yourbrand.com/offer" },
"properties": { "currency": "USD", "value": 89.00, "content_type": "product" }
}]
}
A 28-day cookie matches TikTok's longest click window. If your setting is 7 days, a 7-day cookie is enough.
TikTok pixel vs Events API: use both, deduplicate by event_id
The pixel runs in the browser; the Events API is TikTok's server-side equivalent of Meta's Conversions API. They aren't alternatives. The pixel sees the browsing (page views, add to cart) and the Events API delivers the sales the browser misses.
| TikTok pixel | TikTok Events API | |
|---|---|---|
| Runs in | The visitor's browser | Your server |
| Stopped by | Ad blockers, consent choices, closed tabs, Safari limits | Only by your own code or a missing click ID |
| Best for | Page views, content views, add to cart | Purchases, upsells, anything that must be counted |
| Needs the ttclid from | The URL or its ttclid cookie | Wherever you stored it |
When you run both, the same purchase can reach TikTok twice. TikTok removes the copy when both carry the same event name and the same event_id and arrive within 48 hours of the first one, and it keeps the first event it received (TikTok, event deduplication). Use your order ID or conversion ID as the event_id on both sides. Without it, every sale seen by both counts twice, your reported ROAS doubles, and TikTok bids on sales that didn't happen.

ttclid vs fbclid vs gclid
Every big ad platform has its own click ID, and they all solve the same problem. What differs is where the browser keeps them and how you send them back.
| ttclid | fbclid | gclid | |
|---|---|---|---|
| Platform | TikTok Ads | Meta (Facebook, Instagram) | Google Ads |
| Added by | TikTok, on ad clicks | Meta, on outbound link clicks | Google Ads auto-tagging |
| Browser cookie | ttclid (TikTok pixel) | _fbc, 90 days (Meta pixel) | _gcl_aw, 90 days (Google tag) |
| Sent back server-side through | TikTok Events API (user.ttclid) | Conversions API (fbc) | Google Ads conversion upload |
| How long it counts | Your click-through window, default 7 days | Your attribution setting | Uploads accepted up to 90 days after the click |
If you buy on more than one platform, capture all three on arrival, even the ones you aren't using yet. It costs nothing and it saves you rebuilding the tracking the week you add a channel. The fbclid guide and the gclid guide cover the Meta and Google specifics.
How ElasticFunnels handles ttclid
When we built tracking into ElasticFunnels, we put the click IDs on the server side of the visit, not in a browser cookie that has to survive until checkout, because the browser is the part of the chain you control least.
- It's captured on arrival. Pages hosted on ElasticFunnels read the ttclid from the landing URL on the first visit and store it with that visit, along with fbclid, gclid and the other ad click IDs.
- The sale goes back to TikTok. With the TikTok Ads integration connected, a pixel ID entered and conversion postbacks turned on, a sale on a visit with a ttclid is sent to TikTok through the Events API as a CompletePayment event with the ttclid, order value, currency, order ID, page URL, IP address, user agent and hashed email.
- No ttclid, no send. Sales from visits without a ttclid aren't sent to TikTok. They still appear in your ElasticFunnels reports under their traffic source.
Every feature is on every plan, the TikTok integration included.
- Before you touch bids or creatives because TikTok "stopped converting", click your own ad and follow the ttclid to the thank-you page. Most tracking problems are visible in five minutes this way.
- Don't judge TikTok by the pixel alone. A browser-only setup on mostly iPhone traffic undercounts, and the algorithm optimizes on the undercount.
- Never send a server event without an
event_idwhen the pixel also fires the purchase. Double-counted sales look great for a week and then quietly wreck your bidding. - Compare TikTok's numbers with your store's only over the same window. Anything else is an argument you can't win.
The ttclid is a boring string, and that's the problem: nobody watches it, so it breaks quietly. Keep it from the first page to the sale, send it back from the server with an event_id, and TikTok's numbers stop being a guess.



