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.

  1. Open a private (incognito) window, open developer tools (F12), go to the Network tab and type analytics.tiktok.com/api into the filter box.
  2. Load the page and click Accept (accept all) on the cookie banner.
  3. Wait about 5 seconds. You should see at least one request to analytics.tiktok.com/api/v2/pixel whose payload has "event": "Pageview" (or another event your site sends on load). If nothing appears, the pixel is not firing after consent.
  4. 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.
  5. Look at the Console tab. An error such as ttq.holdConsent is not a function or ttq.grantConsent is not a function points 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.

  1. 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).
  2. If you use TikTok’s consent commands (ttq.holdConsent() before ttq.load):
    • make sure "holdConsent", "revokeConsent" and "grantConsent" are in the ttq.methods list inside the base code. TikTok’s standard snippet does not include them. Without them, ttq.holdConsent() throws an error before ttq.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 get ttq.grantConsent() on every page load too. Until it is called, the pixel only queues events;
    • make sure the order is right: ttq.holdConsent(), then ttq.load(...) and ttq.page(), then ttq.grantConsent() when consent is given. Queued events, including the first page view, are sent at that moment.
  3. 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.
  4. 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_storage changing to granted;
    • 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.
  5. Check the browser console for other errors. A JavaScript error in custom code before ttq.track stops the event. A Content Security Policy that does not allow TikTok’s domains (TikTok lists analytics.tiktok.com, analytics-ipv6.tiktokw.us and ads.tiktok.com) blocks the library; the console shows a CSP violation.
  6. 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, compare context.pixel.code in the request payload with the pixel in Events Manager.
  7. Publish your changes and clear any cache.

Common causes

  • ttq.holdConsent() was added without adding the consent methods to ttq.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

  1. 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.
  2. Reload as a returning visitor who already accepted: the page view leaves without any click.
  3. In Events Manager, the pixel’s Overview shows recent activity (data is not shown in real time; Test Events is quicker).
  4. 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

Guides for your consent tool