Pricing Academy Blog

What is ttclid? TikTok's click ID

The ttclid is the string TikTok puts on your landing page URL when someone clicks your ad. What it is, how long it counts, where it gets lost, and how to send it back so TikTok credits the sale.

Summarize with:
Illustration: the monitor mascot holds up a small click tag and points at it, next to a phone with a play button and a linked landing page
The short answer

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.

Illustration: a phone, a link, a page, a cart and a server in a row, with an arrow looping from the server back to the phone
The ttclid rides from the ad click to your page, is kept with the visit through checkout, and goes back to TikTok with the sale.

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.

SettingDefault for pixel and Events APIOptions
Click-through window7 days after the click1, 7, 14 or 28 days
View-through window1 day after the viewOff, 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 http to https or the bare domain to www without 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.com can't be read on checkout.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.
Illustration: a phone, a redirect, a page and a card in a row, with the arrow cut by scissors after the redirect
One redirect that drops the query string is enough. Everything after it happens without the click ID.

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.

  1. Read it on arrival. Take ttclid from the landing URL on the first page view, before any redirect or script can remove it.
  2. 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.
  3. 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.
  4. Send the purchase with it. Send the conversion through the TikTok Events API with the ttclid in user.ttclid, plus the event name, an event_id, the value, the currency, and whatever matching data you have (hashed email, IP address, user agent).
  5. 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 pixelTikTok Events API
Runs inThe visitor's browserYour server
Stopped byAd blockers, consent choices, closed tabs, Safari limitsOnly by your own code or a missing click ID
Best forPage views, content views, add to cartPurchases, upsells, anything that must be counted
Needs the ttclid fromThe URL or its ttclid cookieWherever 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.

Illustration: a browser and a server each send an arrow to one circle with a check mark, and the monitor mascot points at it
Browser and server report the same sale. A shared event_id lets TikTok count it once.

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.

ttclidfbclidgclid
PlatformTikTok AdsMeta (Facebook, Instagram)Google Ads
Added byTikTok, on ad clicksMeta, on outbound link clicksGoogle Ads auto-tagging
Browser cookiettclid (TikTok pixel)_fbc, 90 days (Meta pixel)_gcl_aw, 90 days (Google tag)
Sent back server-side throughTikTok Events API (user.ttclid)Conversions API (fbc)Google Ads conversion upload
How long it countsYour click-through window, default 7 daysYour attribution settingUploads 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.

My take
  • 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_id when 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.

FAQ

ttclid FAQ

What is ttclid?

ttclid is the TikTok Click ID: a unique value TikTok adds to your landing page URL as ttclid=... when someone clicks your ad. Send it back with your conversions, through the TikTok pixel or the Events API, and TikTok can match the sale to that exact click.

What does ttclid mean in a URL?

It means the visit came from a click on a TikTok ad. The value after ttclid= identifies that one click. It does nothing to the page itself; it is there so the conversion can be credited to the ad later.

Is ttclid a cookie?

It starts as a URL parameter. If the TikTok pixel is on the page and first-party cookies are on (the default), the pixel reads it from the URL and stores it in a first-party cookie called ttclid on your domain.

How long does a ttclid last?

TikTok says each click ID follows the click-through attribution window set in Attribution Manager. For pixel and Events API advertisers the default is 7 days after the click, and you can choose 1, 7, 14 or 28 days. A conversion sent after the window no longer counts for that click.

Can I remove ttclid from my URLs?

Yes. TikTok says you can remove it programmatically or in your site code. Read and store it first: once it is gone from the URL and was never saved, TikTok has nothing to match your conversions to.

What is the difference between ttclid, fbclid and gclid?

They do the same job for different ad platforms. ttclid is TikTok's click ID, fbclid is Meta's (Facebook and Instagram) and gclid is Google Ads'. Each goes back to its own platform: ttclid through the TikTok Events API, fbclid as the fbc value in Meta's Conversions API, gclid in a Google Ads conversion upload.

Do I need the TikTok Events API if I already have the pixel?

For sales, yes. The pixel only reports what the browser manages to send, and ad blockers, consent choices and closed tabs all stop it. The Events API reports from your server. Run both and give the same purchase the same event_id so TikTok counts it once.

What is a click ID?

A unique ID an ad platform adds to your landing page URL for each ad click, such as ttclid for TikTok, fbclid for Meta and gclid for Google. You keep it with the visit and send it back with the conversion, so the platform can credit the right ad.

Send TikTok the sales it can't see

Every feature on every plan. Start a 14-day free trial.