Fix guide · Any website · medium · about 30 min
TikTok Pixel not firing after cookie consent: how to fix it
For the finding “TikTok Pixel does not fire after consent”. Also for: Shopify, WordPress, Webflow, Framer.
What this means
The TikTok Pixel script is on your page, but after cookies were accepted, no events were sent to TikTok. As far as TikTok can tell, this page has no visitors.
Why it costs you money:
- TikTok cannot see page views or conversions from this page, so campaigns optimize without data and reported results are too low.
- Audiences built from website visitors stop growing.
- You keep paying for ads while the system that should learn from them is switched off.
How sure we are: if our checker found and accepted your cookie banner, this is reported as critical. If we did not find a banner we could operate, it is reported as high: the pixel may be waiting for a consent signal from a banner we did not recognize. In that case, test it yourself as described below before changing anything.
How to confirm it yourself
Our check runs from a browser in the EU, so EU consent rules on your site apply to it. If your banner only appears for EU visitors, use a VPN or ask a colleague there.
- Open a private (incognito) window, open developer tools (F12), go to the Network tab and type
analytics.tiktok.com/apiinto the filter box. - Load the page and click Accept (accept all) on the cookie banner.
- Wait about 5 seconds. You should see at least one request to
analytics.tiktok.com/api/v2/pixelwhose payload has"event": "Pageview"(or another event your site sends on load). If nothing appears, the pixel is not firing after consent. - Click to another page on the site. If events appear only now, the pixel starts on the next page view, so you lose the first page of every new visit, which is usually your ad’s landing page.
- Look at the Console tab. An error such as
ttq.holdConsent is not a functionorttq.grantConsent is not a functionpoints straight at the most common cause on this list (step 2 below).
The TikTok Pixel Helper extension and the Test Events tab in TikTok Events Manager (Tools > Events > Data sources > your pixel) show the same: accept cookies and watch whether a page view arrives. TikTok also documents a debug mode: set a cookie named pixel_debug to true on your site, reload, and the pixel logs its activity in the console with the prefix [TT].
How to fix
The pixel is installed, but something between “visitor clicks Accept” and “pixel sends” is broken. Work along that chain.
- Check that the consent tool records the choice. After clicking Accept, reload: the banner should not come back. If it does, fix the consent tool first (a common cause is a cookie domain mismatch).
- If you use TikTok’s consent commands (
ttq.holdConsent()beforettq.load):- make sure
"holdConsent","revokeConsent"and"grantConsent"are in thettq.methodslist inside the base code. TikTok’s standard snippet does not include them. Without them,ttq.holdConsent()throws an error beforettq.load()runs, and the pixel never starts at all; - make sure your banner’s Accept handler actually calls
ttq.grantConsent(), on the current page, and that returning visitors who accepted earlier getttq.grantConsent()on every page load too. Until it is called, the pixel only queues events; - make sure the order is right:
ttq.holdConsent(), thenttq.load(...)andttq.page(), thenttq.grantConsent()when consent is given. Queued events, including the first page view, are sent at that moment.
- make sure
- Check which category the pixel belongs to. If your consent tool blocks the script until consent, the TikTok base code must be in the category that “Accept” grants, usually marketing, with the category label spelled exactly as the tool expects. Check that the tool re-activates the blocked script after Accept without needing a reload.
- If the pixel is in Google Tag Manager (GTM):
- open GTM’s Preview mode, load the site and click Accept. A consent update should appear, with
ad_storagechanging togranted; - look at the TikTok tag: is it “fired” or “not fired”? If it is blocked by consent, the consent update is not arriving. If it is not fired, its trigger never ran;
- a common problem is a tag that only has an “All Pages” trigger, which runs once, before the visitor clicked Accept. Add a trigger that runs when consent is granted, such as the custom event your consent tool pushes to the data layer, and make sure the tag cannot fire twice on the same page. GTM Preview shows the exact event name your tool pushes when you click Accept.
- open GTM’s Preview mode, load the site and click Accept. A consent update should appear, with
- Check the browser console for other errors. A JavaScript error in custom code before
ttq.trackstops the event. A Content Security Policy that does not allow TikTok’s domains (TikTok listsanalytics.tiktok.com,analytics-ipv6.tiktokw.usandads.tiktok.com) blocks the library; the console shows a CSP violation. - Check the pixel ID. The ID in
ttq.load('...')must be the pixel you look at in Events Manager. If events leave but never show up, comparecontext.pixel.codein the request payload with the pixel in Events Manager. - Publish your changes and clear any cache.
Common causes
ttq.holdConsent()was added without adding the consent methods tottq.methods, so the base code stops with an error.ttq.grantConsent()is only called in the banner’s click handler, so returning visitors who accepted earlier stay on hold.- The pixel is mapped to a consent category that the “Accept” button does not grant.
- The GTM tag fires only on the initial page view, before consent is given, and never again on that page.
- The consent tool was replaced, but the old consent check is still in the pixel code or GTM.
- A Content Security Policy or a script error stops the TikTok library.
How to verify the fix
- In a fresh private window: no pixel events before Accept, and a page view request within a few seconds after Accept, on the same page.
- Reload as a returning visitor who already accepted: the page view leaves without any click.
- In Events Manager, the pixel’s Overview shows recent activity (data is not shown in real time; Test Events is quicker).
- Re-run the check on IsPixelWorking. The issue should be gone, and “TikTok Pixel fires before cookie consent” should not appear in its place.
Sources
- TikTok API for Business, Pixel Cookie consent mode (
ttq.methods,holdConsentbeforettq.load, queued events sent ongrantConsent, every page): https://business-api.tiktok.com/portal/docs?id=1795929012554754 - TikTok API for Business, Install Pixel using code (base code, debug mode with the
pixel_debugcookie, pixel detail tabs): https://business-api.tiktok.com/portal/docs?id=1739585702922241 - TikTok API for Business, Work with CSP: https://business-api.tiktok.com/portal/docs?id=1739585704427522
- TikTok Business Help Center, Events Manager: monitor and diagnose (Overview, Event Status, data not in real time, Test Events): https://ads.tiktok.com/resources/help/article/tiktok-events-manager-monitor-and-diagnose?lang=en
- TikTok Business Help Center, TikTok Pixel Helper: https://ads.tiktok.com/resources/help/article/tiktok-pixel-helper-2.0?lang=en
- Google Tag Manager Help, Tag Manager consent mode support: https://support.google.com/tagmanager/answer/10718549