Platforms

How to set up the TikTok Pixel with Cookiequiet

The TikTok Pixel sets advertising cookies such as _ttp and ttclid on your domain for 13 months, so it belongs in the marketing category and needs consent first in the EEA and the UK. Mark the base code with type="text/plain" and data-cq-category="marketing" so it runs only after consent, or use TikTok's own consent mode: ttq.holdConsent() before ttq.load(), then ttq.grantConsent() or ttq.revokeConsent() from Cookiequiet's cq:consent event.
Published 21 October 2026 · By the Cookiequiet team · Markdown

Steps

Get the base codeIn TikTok Events Manager, open your pixel and copy the base code for manual installation. It loads events.js from analytics.tiktok.com and calls ttq.load with your pixel ID and ttq.page().
Paste it after the Cookiequiet snippetPut the base code in the head of every page, right after the Cookiequiet snippet.
Mark itChange the opening tag to type="text/plain" with data-cq-category="marketing" and leave the code inside unchanged.
Or use TikTok's consent modeAdd holdConsent, revokeConsent and grantConsent to the ttq.methods array, call ttq.holdConsent() before ttq.load(), and grant or revoke from a cq:consent listener.
Gate event callsCalls such as ttq.track('CompletePayment') in page code must sit in marked scripts or run after the pixel, so they follow the same choice.
Test with Reject allIn a private window, click Reject all and check that no _ttp cookie is set and no event reaches TikTok. Accept all, reload, and check the events in TikTok Pixel Helper or Events Manager.

What does the TikTok Pixel set?

TikTok's help centre lists the cookies the pixel uses, all classed by TikTok as advertising cookies that last 13 months from the last date they were used:

CookieDomainType
_ttpyour website domainfirst-party
_ttp.tiktok.comthird-party
ttcsid, ttcsid_<pixel code>your website domainfirst-party
ttclidyour website domainfirst-party
_pangleanalytics.pangle-ads.comthird-party

TikTok describes their purpose as measuring and improving ad campaigns and personalising the experience, including ads, on TikTok. First-party cookies are on by default and can be switched off in the pixel settings; third-party cookies are on by default. Because the pixel links visits to people on TikTok for ads and audiences, it belongs in the marketing category in Cookiequiet. TikTok's own guidance says that if you must obtain consent, your site has to stop setting and using cookies when a visitor declines, with a tag manager, a consent management platform or TikTok's pixel consent mode.

Option 1: mark the base code

Put the base code right after the Cookiequiet snippet and change only the opening tag:

html
<script type="text/plain" data-cq-category="marketing">
/* TikTok Pixel base code from Events Manager, unchanged:
it defines ttq, then calls ttq.load('YOUR_PIXEL_ID') and ttq.page() */
</script>

Cookiequiet runs it when marketing is granted: at once on later visits where the stored choice includes it, and at the moment of the click when the visitor accepts during the visit. Until then nothing loads from analytics.tiktok.com and no _ttp cookie is set. Event calls in your page code, such as ttq.track('CompletePayment'), go in scripts marked the same way. Tags already marked for CookieYes or Cookiebot keep working; see switching from CookieYes.

TikTok's developer documentation describes a "default opt-out" mode for sites that must ask first. Add "holdConsent", "revokeConsent" and "grantConsent" to the ttq.methods array of the base code, and call ttq.holdConsent() before ttq.load(). The pixel then queues events without sharing them. ttq.grantConsent() sends them, including those queued in the session; ttq.revokeConsent() drops them and stops sharing. TikTok notes that revoking does not affect data already shared. Connect it to Cookiequiet with the cq:consent event, which carries the granted categories in detail.categories and the stored choice, if any, in detail.state:

html
<script>
window.addEventListener('cq:consent', function (e) {
if (!window.ttq) return;
if (e.detail.categories.indexOf('marketing') >= 0) ttq.grantConsent();
else if (e.detail.state) ttq.revokeConsent();
});
</script>

The listener only revokes once the visitor has made a choice, so events stay queued while the banner is open. Place it before the base code. Note the difference with option 1: here the TikTok script loads on every page, and only the sharing waits for consent. If the auto-blocker is on and the base code runs after Cookiequiet (from Tag Manager, for example), Cookiequiet holds analytics.tiktok.com under marketing until consent anyway, so option 1 is the simpler choice where you can edit the code.

What about Google Tag Manager?

TikTok documents a Tag Manager setup through Events Manager. To put it behind consent, give the pixel tag a Custom Event trigger on cq_consent, Some Custom Events, condition cq_marketing equals true, with Tag firing options set to Once per page, and add ad_storage under Require additional consent for tag to fire. Cookiequiet pushes cq_consent on each page load where a choice is stored and after every choice, and grants ad_storage with marketing. The Google Tag Manager guide explains the variables.

EU-specific points

  • The Events API sends the same conversions from your server. It describes the same visitor, so send those events only for visitors whose consent log entry includes marketing, as with the Meta Pixel and its Conversions API.
  • Advanced Matching sends hashed email addresses or phone numbers with events; it is part of the same marketing purpose.
  • List the pixel's cookies with their 13-month lifetime in your cookie policy; the scanner names the TikTok Pixel when it finds it.

How do I test it?

  1. Open the site in a private window and click Reject all. No _ttp cookie, and with option 1 no request to analytics.tiktok.com.
  2. Clear the cookies, click Accept all, reload: the pixel loads, _ttp appears, and TikTok Pixel Helper shows the page event.
  3. In Events Manager, test events show the visit.
  4. Check the consent log in the Cookiequiet dashboard.

Cookiequiet is free for one website with geo-targeting; Starter is €3 per website per month with unlimited pageviews.

Questions

Marketing. TikTok classes all of the pixel's cookies as advertising cookies, used to measure campaigns and personalise ads on TikTok.
holdConsent, called before ttq.load, queues events without sharing them. grantConsent shares them, including those queued in the session, and revokeConsent stops sharing and drops the queue. They must be added to the ttq.methods array of the base code.
Consent Mode governs Google tags. TikTok mentions it only for configuring Google tags in Tag Manager. Gate the pixel with a cq_consent trigger, a marked base code or TikTok's own consent calls.
TikTok lists 13 months from the last date they were used for _ttp, ttcsid, ttclid and the Pangle cookie.

Put a quiet banner on your website today

Free for one website with every core feature, no card and no trial clock. Upgrade a website to Starter for $3 a month to match your brand with AI and drop the branding, or to Pro for $9 to design it with the AI agent.