On this page
What this issue is
When someone clicks a TikTok ad, TikTok can append a click ID called ttclid to your URL, for example https://example.com/offer?ttclid=abc123. The TikTok Pixel reads it and stores it in the first-party cookie _ttp. TikTok uses these to link a later lead or purchase back to the ad click.
Why it costs you leads or sales
Your leads and sales still happen, but TikTok can't see which ads produced them. Reported conversions drop, campaigns look worse than they are, and TikTok's optimisation has less signal to find similar buyers. You may cut or pause ads that are really working.
- TikTok ad clickURL has ?ttclid=...
- Landing pageRedirect or blocked pixel drops ttclid, no _ttp set
- Form or checkoutNo ttclid or _ttp to save
- Conversion eventTikTok can't match it to the ad
The click ID never reaches the conversion, so TikTok can't match it.
Example: 100 real conversions from TikTok ads, with and without ttclid and _ttp stored. Numbers are illustrative.
Common causes
| Cause | What happens |
|---|---|
| Pixel not on the landing page | Nothing reads ttclid or sets _ttp |
| Redirect strips query strings | ttclid is gone before the pixel loads |
| Pixel waits for consent | _ttp isn't set until the visitor accepts |
| Pixel loaded in a tag that never fires | No cookie, no events |
| ttclid not saved to a hidden field | Server events and CRM have no click ID |
| Cookie cleared or blocked by browser | _ttp missing on later pages |
How to check if your site has it
Open your landing page with a test ttclid
In a private window, visit your landing page URL with
?ttclid=test123added. Accept cookies if a banner appears.Check the URL after load
If
ttcliddisappears from the address bar and your page didn't remove it on purpose, a redirect is stripping it.Look for the _ttp cookie
Open DevTools, then Application (Chrome) or Storage (Firefox), then Cookies. Look for
_ttpon your domain.Check the pixel request
In the Network tab, filter for
tiktokand confirm requests to analytics.tiktok.com fire on page load.Submit a test lead
Check whether the ttclid value reached your CRM or order record, if you store it.
How to fix it
The fix has three parts: make sure the TikTok Pixel loads on the landing page, keep ttclid through any redirects, and save the values with the lead or order so they can be sent later.
Add the TikTok Pixel base code
Use the TikTok Pixel template or a Custom HTML tag with your pixel code. Trigger it on All Pages, including the landing page.
Respect consent properly
If you use a consent banner, make the tag fire once marketing consent is granted, and confirm it fires on the landing page after acceptance.
Capture ttclid in a variable
Create a URL variable (Query) with key
ttclid. Use it to fill a hidden form field or a first-party cookie.Test in Preview mode
Load the page with
?ttclid=test123and confirm the tag fires and_ttpappears.
Install the pixel once
Use the TikTok for WordPress plugin or your tag manager, not both, so the pixel loads on every page.
Check redirect plugins
Redirect or SEO plugins and caching rules can drop query strings. Turn on query string passthrough, or exclude ad landing pages from the redirect.
Add hidden fields
Add a hidden field named ttclid to your form plugin and fill it with the script below.
Connect TikTok properly
Use the TikTok sales channel app in Shopify admin and confirm the pixel is connected to the right TikTok account.
Check for custom pixel conflicts
In Settings, then Customer events, make sure you don't run a second, broken TikTok pixel.
Keep ttclid on the order
Save ttclid in a cart attribute using the script below, so it is on the order for server-side events.
Add the pixel in site settings
Paste the TikTok Pixel code in Project settings, then Custom code, Head code, and publish.
Add a hidden field
Add a hidden input named ttclid to your form and fill it with the script below in the page's custom code.
Load the pixel in the head
Place the TikTok Pixel base code in the head of every page, including landing pages.
Pass the query string on redirects
In your server or CDN rules, keep the full query string when redirecting (for example, http to https, or www to non-www).
Store ttclid yourself
Save it in a first-party cookie and a hidden field with the script below.
(function () {
var params = new URLSearchParams(window.location.search);
var ttclid = params.get('ttclid');
if (ttclid) {
var days = 90;
var expires = new Date(Date.now() + days * 864e5).toUTCString();
document.cookie = 'ttclid=' + encodeURIComponent(ttclid) + '; expires=' + expires + '; path=/; SameSite=Lax';
}
var match = document.cookie.match(/(?:^|; )ttclid=([^;]*)/);
var saved = match ? decodeURIComponent(match[1]) : '';
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('input[name="ttclid"]').forEach(function (el) {
el.value = saved;
});
});
})();# Nginx: $is_args$args keeps ?ttclid=... on redirect
server {
listen 80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}How to confirm it's fixed
- Landing page with ?ttclid=test123 keeps the parameter in the URL after load
- The _ttp cookie appears after the pixel loads (and consent, if required)
- TikTok requests to analytics.tiktok.com fire on the landing page
- The hidden ttclid field holds the value when the form is submitted
- The test lead or order in your CRM or store contains the ttclid
- TikTok Events Manager shows the event with browser and click ID matching
How to prevent it happening again
This usually breaks after a redirect rule, theme change, consent banner update or tag manager publish. Re-test a landing page with a test ttclid after each of those changes. Keep one owner for the pixel setup so it isn't installed twice or removed by accident.
Day 1
A new redirect rule is added for www and https.
Day 2
It drops the query string, so ttclid is lost on every TikTok click.
Week 2
TikTok reports fewer conversions and the campaign looks weak.
Week 3
The redirect keeps the query string and attribution recovers.
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor runs your real customer journey on a schedule, from the EU or the US, and checks the tracking hits sent to TikTok along the way. If the TikTok data needed for attribution is missing, you get a single alert with a screenshot and a likely cause. A failure is re-checked from a second region first, so a one-off glitch doesn't wake you up.
Test traffic is marked (utm_source=funnelguard, fg_test=1, an fg_test cookie and its own user agent), never clicks real ads and never bypasses consent banners or bot protection. You can start on the Free plan (1 site, 2 journeys, daily checks, no card), or run the free read-only website audit.
Questions people ask
What is ttclid and why does TikTok use it?
ttclid is the TikTok click ID added to your landing page URL when someone clicks a TikTok ad. TikTok uses it to match a later conversion, such as a lead or purchase, back to the exact ad click.
Why is my _ttp cookie missing?
The _ttp cookie is set by the TikTok Pixel, so it is missing if the pixel isn't on the page, is blocked, or is waiting for marketing consent. Check that the pixel loads on the landing page and that you accepted cookies in your test.
Why is ttclid disappearing from my URL?
Most often a redirect, such as http to https or www to non-www, drops the query string. Change the rule so it keeps the full query string, then test again with ?ttclid=test123.
How do I store ttclid with a lead?
Save the ttclid from the URL into a first-party cookie, then copy it into a hidden form field named ttclid. The value then arrives in your CRM with the lead and can be used for server-side events.
Do I need ttclid if I use the TikTok Events API?
It helps a lot. Sending the ttclid and the _ttp value with server events gives TikTok stronger signals to match the conversion to the ad click, alongside other allowed customer data.
Is it okay to store ttclid without consent?
That depends on your local privacy rules and your consent setup. Follow your consent banner choices and get legal advice if unsure. Don't bypass a visitor's decision to deny marketing cookies.
How can I test TikTok tracking on my landing page?
Open the page in a private window with ?ttclid=test123, accept cookies, and check DevTools for the _ttp cookie and TikTok network requests. A monitoring tool like FunnelGuard can repeat this check on a schedule.