Advertising cookie · TikTok Pixel
_ttp Cookie: What It Is, Who Sets It, and Consent Rules
Last verified 2026-10-17 · Updated 2026-10-17
On this page
What the _ttp Cookie Does on Your Site
The _ttp cookie is a first-party advertising cookie that the TikTok Pixel sets on your domain to tell one browser apart from another for the measurement of TikTok ads. The TikTok Pixel "will automatically store a unique identifier in a first-party cookie named _ttp", according to the TikTok API for Business documentation. TikTok uses the _ttp cookie, like every cookie of the TikTok Pixel, "to measure and improve the performance of advertising campaigns", according to the TikTok help on cookies with TikTok Pixel. The _ttp cookie stays for 13 months from the last date the TikTok Pixel used the cookie, so a regular visitor keeps the same identifier.
TikTok lists a second _ttp cookie as a third-party cookie on .tiktok.com. A cookie scanner therefore shows 2 _ttp cookies with different domains, and the copy on your own domain is the one this page covers.
| Cookie name | _ttp |
|---|---|
| Vendor | TikTok Pixel |
| Company | TikTok Pte. Ltd. (TikTok Technology Limited for visitors in the EU) |
| Category | Advertising |
| Party | First-party |
| Domain | Your own root domain, for example example.com |
| Set by | JavaScript, through the TikTok Pixel library (events.js) from analytics.tiktok.com |
| Retention | 13 months (395 days), renewed at every page view |
| HttpOnly | No |
| Secure | Not documented |
| SameSite | Not documented |
| Cookie Consent category | targeting |
| Privacy Consent vendor category | Advertising (advertising) |
Who Sets the _ttp Cookie
The TikTok Pixel sets the _ttp cookie with JavaScript on your domain through the TikTok Pixel library from analytics.tiktok.com. First-party cookies "are enabled by default with the TikTok Pixel", according to the TikTok help on cookies with TikTok Pixel. The TikTok help article on the TikTok Pixel calls first-party cookies "optional" instead. Check the cookie setting of your pixel in TikTok Events Manager.
The TikTok Pixel writes the _ttp cookie only for a pixel with first-party cookies on. A TermsFeed check in Chrome on 17 October 2026 loaded the TikTok Pixel with a test Pixel ID that belongs to no TikTok account. The check found no _ttp cookie, only session storage keys such as tt_sessionId. A Pixel ID without an account tells nothing about the cookie on a live pixel, so the check confirms neither the _ttp cookie nor its consent behavior. Test the TikTok Pixel with your own Pixel ID in Chrome DevTools.
Read how TikTok Pte. Ltd. handles the data in the TikTok Pixel privacy policy, and sign the TikTok For Business Jurisdiction-Specific Terms before you collect data from visitors in the EU or the UK. Both documents appear in the sources at the end of this page.
Does the _ttp Cookie Need Consent?
Yes, the _ttp cookie needs consent in the EU and the UK, and needs no prior opt-in in California. The table gives the rule for each law.
| Law | Consent before the cookie is set | Opt-out right | Source |
|---|---|---|---|
| EU ePrivacy Directive + GDPR | Required | Withdraw at any time | Article 5(3), ePrivacy Directive |
| UK PECR | Required | Withdraw at any time | Regulation 6 and Schedule A1, PECR |
| California CCPA | No general opt-in | Opt out of sale and sharing | Cal. Civ. Code 1798.120 |
The consent table describes what each law requires and is not legal advice. Whether a law applies to your site depends on where your visitors are, where your business is based, and how you set up the TikTok Pixel, such as the cookie settings of your pixel in TikTok Events Manager.
The ePrivacy Directive requires consent before a site sets the _ttp cookie. The General Data Protection Regulation (GDPR) sets the standard for that consent: freely given, specific, informed, and unambiguous.
The UK Privacy and Electronic Communications Regulations (PECR) require consent before a site sets the _ttp cookie.
The California Consumer Privacy Act (CCPA) sets no general opt-in requirement before a site sets the _ttp cookie. The CCPA treats the data the _ttp cookie collects for cross-context behavioral advertising as sharing. Offer visitors a way to opt out of sale and sharing, such as a "Do Not Sell or Share My Personal Information" link or the alternative opt-out link the CCPA regulations allow. Honor Global Privacy Control (GPC) signals as opt-out requests. Sharing the data of a consumer under 16 needs opt-in consent instead: from the consumer from 13 to 15 years, and from a parent under 13.
Read how each law decides which cookies need consent in the EU ePrivacy Directive + GDPR guide, the UK PECR guide, and the California CCPA guide.
How to Block the _ttp Cookie Until Visitors Accept
Block the _ttp cookie by holding back the TikTok Pixel base code until the visitor accepts advertising cookies. TermsFeed Free Cookie Consent and TermsFeed Privacy Consent place the TikTok Pixel in the advertising category. Check whether an exemption applies to your own use of the TikTok Pixel in the consent rules for the _ttp cookie.
The TikTok Pixel writes no _ttp cookie while the base code waits as a tagged script, and TikTok receives no event from a visitor who declines.
Block the _ttp Cookie With TermsFeed Free Cookie Consent
TermsFeed Free Cookie Consent runs a tagged script only after the visitor accepts its category. Change type="text/javascript" to type="text/plain" and add data-cookie-consent="targeting", the Cookie Consent category for advertising cookies. The tagged the TikTok Pixel base code looks like this.
<script type="text/plain" data-cookie-consent="targeting">
!function (w, d, t) {
w.TiktokAnalyticsObject=t;var ttq=w[t]=w[t]||[];ttq.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie","holdConsent","revokeConsent","grantConsent"],ttq.setAndDefer=function(t,e){t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i<ttq.methods.length;i++)ttq.setAndDefer(ttq,ttq.methods[i]);ttq.instance=function(t){for(
var e=ttq._i[t]||[],n=0;n<ttq.methods.length;n++)ttq.setAndDefer(e,ttq.methods[n]);return e},ttq.load=function(e,n){var r="https://analytics.tiktok.com/i18n/pixel/events.js",o=n&&n.partner;ttq._i=ttq._i||{},ttq._i[e]=[],ttq._i[e]._u=r,ttq._t=ttq._t||{},ttq._t[e]=+new Date,ttq._o=ttq._o||{},ttq._o[e]=n||{};n=document.createElement("script")
;n.type="text/javascript",n.async=!0,n.src=r+"?sdkid="+e+"&lib="+t;e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(n,e)};
ttq.load('YOUR_PIXEL_ID');
ttq.page();
}(window, document, 'ttq');
</script>
Cookie Consent runs the tagged code after the visitor clicks "I agree" or accepts the targeting category in the Preferences Center. The illustration shows the consent banner and the script it releases.
targeting. Illustration of the consent banner.Cookie Consent is free and needs no account. Build your free consent banner with TermsFeed Free Cookie Consent.
Block the _ttp Cookie With TermsFeed Privacy Consent
Add the TikTok Pixel from its template in TermsFeed Privacy Consent and type your Pixel ID, which TikTok Ads Manager shows under Tools, Events, and Web Events. The TikTok Pixel loads only after the visitor accepts the TikTok vendor, and Privacy Consent sends the TikTok consent signal for you.
A visitor who withdraws consent in the Preferences Center triggers ttq.revokeConsent() on the same page. Remove old holdConsent and grantConsent calls from your theme, so the template alone controls the TikTok consent signal.
The TikTok Pixel template asks for the Pixel ID and fills every other field of the vendor. Pick the "TikTok Pixel" card under Advertising, enter the Pixel ID, and click "Add TikTok Pixel". Find the Pixel ID in TikTok Ads Manager under Tools › Events › Web Events › your pixel. The illustration shows the template form in the TermsFeed app.
Privacy Consent detects the location of each visitor and records every answer in a consent log. Set up the TikTok Pixel from its template with TermsFeed Privacy Consent.
Block the _ttp Cookie With the TikTok Pixel Consent Mode
Call ttq.holdConsent() before ttq.load() in the base code, and the TikTok Pixel queues events without sharing them with TikTok. Call ttq.grantConsent() once the visitor accepts advertising cookies, and the TikTok Pixel shares the queued events, according to the TikTok documentation on pixel cookie consent mode.
Call ttq.revokeConsent() when a visitor withdraws consent. The revoke call stops further events but "does not affect data shared with the TikTok server" before the call.
<script>
ttq.holdConsent(); // add before ttq.load(...) in the base code
</script>
<script type="text/plain" data-cookie-consent="targeting">
ttq.grantConsent();
</script>
Stop the _ttp Cookie in TikTok Events Manager
Open your pixel in TikTok Events Manager and choose to use only third-party cookies with the TikTok Pixel to stop the _ttp cookie on your domain. TikTok sets "no new first-party cookies" from that moment, according to the TikTok help on cookies with TikTok Pixel.
The setting stops the first-party cookies only. TikTok still sets its third-party cookies and still receives every event, so the TikTok Pixel needs consent with first-party cookies off as well.
How to Verify That the _ttp Cookie Waits for Consent
Verify the setup in a private window. Open Chrome DevTools, select the Application tab, and open Cookies. Click "I decline" on the consent banner and reload the page. The _ttp cookie must not appear in the list until you accept advertising cookies.
How Long the _ttp Cookie Lasts
The _ttp cookie lasts 13 months (395 days), and the lifetime restarts at every page view. Safari caps the cookies that JavaScript sets at 7 days of Safari use without an interaction with your site, according to the WebKit team behind Safari.
The _ttp cookie lasts "13 months from the last date it was used", according to the TikTok help on cookies with TikTok Pixel. The 13 months therefore restart at every visit with the TikTok Pixel, so a regular visitor keeps the same _ttp identifier.
The TikTok website cookie policy lists a ttp cookie with 1 year for the websites of TikTok itself. That lifetime covers the sites of TikTok, not the TikTok Pixel on your site.
Scripts and Requests of the TikTok Pixel That Come With the _ttp Cookie
The catalog lists 2 scripts, pixels, and data endpoints of the TikTok Pixel, which a cookie scanner or the Network tab of Chrome DevTools shows next to the _ttp cookie. Block the main script, and the requests in the table stop with the main script.
| Type | Resource | Host | What it does |
|---|---|---|---|
| Script | TikTok Pixel library (events.js) | analytics.tiktok.com | The TikTok Pixel library loads from analytics.tiktok.com and writes the _ttp cookie on your domain. |
| Data endpoint | TikTok Pixel event endpoint (api/v2/pixel) | analytics.tiktok.com | The event endpoint receives every page view and event that the TikTok Pixel reports, with the identifier from the _ttp cookie. |
_ttp Cookie FAQs
Is _ttp a necessary cookie?
No, the _ttp cookie is not a strictly necessary cookie. Firstly, your site works the same for a visitor who refuses the _ttp cookie. Secondly, TikTok lists the _ttp cookie among its advertising cookies, which measure and improve the performance of ad campaigns. Thirdly, the TikTok terms for business products require "all necessary and verifiable prior consents" from visitors in the EEA and the UK.
Why are there 2 _ttp cookies?
TikTok sets a _ttp cookie on your own domain and a second _ttp cookie on .tiktok.com. The copy on your domain is a first-party cookie that the TikTok Pixel writes with JavaScript. The copy on .tiktok.com is a third-party cookie that TikTok sets on its own domain.
What is the difference between _ttp and ttclid?
The _ttp cookie identifies the browser on every visit, and the ttclid cookie stores the TikTok Click ID after a click on a TikTok ad. TikTok appends the ttclid parameter to the landing page URL of an ad, and the TikTok Pixel saves the value in a first-party cookie with the same name.
How long does the _ttp cookie last?
The _ttp cookie lasts 13 months from the last date the TikTok Pixel used the cookie. Safari deletes the cookie earlier, after 7 days of Safari use without an interaction with your site, because Safari caps cookies that JavaScript writes.
Sources for the _ttp Cookie
The facts on this page come from the documentation TikTok publishes, checked on 2026-10-17. The catalog lists every source so you check each fact yourself.
- TikTok For Business, Use cookies with TikTok Pixel
- TikTok API for Business, Send the TikTok cookie (_ttp)
- TikTok API for Business, Pixel cookie consent mode
- TikTok For Business, How to use cookies with TikTok Pixel
- TikTok For Business, About TikTok Pixel
- TikTok API for Business, Send the TikTok Click ID (ttclid)
- TikTok, Website cookies policy
- TikTok, Business Products (Data) Terms
- TikTok Pixel privacy policy
- TikTok For Business Jurisdiction-Specific Terms