Fix guide · Webflow · medium · about 30 min
OpenAI Pixel not firing after cookie consent on Webflow
For the finding “OpenAI Pixel does not fire after consent”. Also for: Any website, Shopify, WordPress, Framer.
What this means
The OpenAI Pixel (the ChatGPT Ads Measurement Pixel) is on your Webflow site, but after cookies were accepted, no events were sent to OpenAI. As far as ChatGPT Ads can tell, this page has no visitors.
Why it costs you money:
- ChatGPT Ads cannot see page views or conversions from this page, so reported conversions are too low and your cost per conversion looks worse than it is.
- Conversion-optimized campaigns learn from these events. Without them, they optimize on little or nothing, while you keep paying for clicks.
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 banner we did not recognize. Test it yourself before changing anything.
How to confirm it yourself
Our check runs from a browser in the EU. If your consent tool shows its banner only in some regions, use a VPN or ask a colleague in the EU.
- Open your published site on the domain your ads link to, in a private (incognito) window.
- Open developer tools (F12), go to the Network tab and filter by
bzr.openai.com. - Click Accept on the cookie banner and wait about 5 seconds. Open the requests’ payload: you should see an event with the
typepage_viewed(or another event your site sends on page load). Service messages whose type starts withopenai::oroai::do not count (at the time of writing the SDK sends these on its own; OpenAI does not document them). - If no measurement event appears, the pixel does not fire after consent. Click to another page: if events only appear now, the pixel starts one page too late and you lose the first page of every visit, usually the page your ad points to.
- In the Console tab, type
typeof oaiq."undefined"means the pixel code never ran on this page (it may still be held back by the consent tool)."function"only means the snippet ran: it creates a queue before the SDK arrives, and OpenAI’s GTM template creates one too. Filter the Network tab byoaiq.min.jsand check that the SDK itself loaded (status 200); if it did, the problem is in the consent or event calls. Also look for errors such asoaiq is not defined.
How to fix
Something between “visitor clicks Accept” and “pixel sends an event” 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. Consent Pro on a custom domain needs a paid plan: without one, the banner does not appear on the live domain, and scripts waiting for consent never run.
- If the consent tool holds back the OpenAI snippet:
- Consent Pro version 2 assigns a category when it scans your site, and that category wins over an
fs-consent-categoriesattribute. Open the app, check that the OpenAI script is listed under Marketing, and that your banner’s Accept button grants Marketing. - Switched consent tools? Scripts still marked
type="fs-cc"are only started by Finsweet’s olderfs-cc.jslibrary. If that library is gone and your new tool does not handle that attribute, those scripts never run. - OneTrust app: the snippet belongs in the app’s Blocked Scripts section; check there that it is saved and the site was published afterwards.
- The
page_viewedcall must be released with the pixel. If the snippet is held back but a separate, unblocked script callsoaiq("measure", "page_viewed", ...), that call runs before the pixel exists and fails. Put it inside the same held-back script, afterinit. - No
oaiq("consent", false)in a held-back snippet. It would run after Accept and switch measurement off again.
- Consent Pro version 2 assigns a category when it scans your site, and that category wins over an
- If you use the pixel’s consent command (the script loads on every page and your code calls
oaiq("consent", ...)), check both halves:-
Something must call
oaiq("consent", true)after Accept on the same page, and on later pages for visitors who accepted earlier. With Consent Pro, thewindow.FinsweetConsentPro.push(["consent", ...])callback runs when Consent Pro is ready; Consent Pro reports later changes, such as a click on Accept, as the separateconsentpro:consent-updatedevent. Listen for that event as well, as in the code in “OpenAI Pixel fires before cookie consent on Webflow”. -
Send
page_viewedagain after switching consent on. OpenAI says events blocked while consent isfalseare not replayed:oaiq("consent", true); oaiq("measure", "page_viewed", { type: "contents" }); -
A denial can also come from the pixel: OpenAI says it keeps consent
falsewhen it finds a stored denial. A visitor who rejected earlier stays blocked until your code callsoaiq("consent", true)after they change their mind. -
If the Consent Pro script is removed or fails to load, a callback that waits for it never runs, and neither does the pixel’s
init.
-
- If the pixel is in Google Tag Manager (GTM):
- Open GTM’s Preview mode, enter your published URL and click Accept. Check that a consent update appears with
ad_storagechanging togranted, then check whether the OpenAI tag fired or was blocked by consent. - A tag with only a page view trigger runs once, before the visitor answers, and is blocked. Add the trigger your consent tool documents: Consent Pro’s GTM guide uses a Custom Event trigger named
consent-updated; Cookiebot pushescookie_consent_marketing. Keep thead_storageconsent requirement and set the tag to fire Once per page. - With Stape’s OpenAI Ads Pixel tag, check Consent Granted: if it is
false, the tag holds events until it fires again with consent granted. OpenAI’s own template has no consent field; it relies on the tag’s Consent Settings and triggers.
- Open GTM’s Preview mode, enter your published URL and click Accept. Check that a consent update appears with
- Check script order. On Webflow, page-level custom code is placed after the site-wide code in the same section, and Footer code comes after everything in the
<head>. If OpenAI’s snippet is in Footer code but a page’s Inside<head>tag field callsoaiq(...), that call fails. Put the snippet in Site settings > Custom code > Head code. - Check that the pixel is on every page. Code in one page’s settings, in a Code Embed on some pages only, or missing from CMS template pages or a secondary locale (Webflow Localization lets each locale have its own page code) leaves those pages silent.
- Check the console for other errors. A script error before the
measurecall, or a Content Security Policy that does not allowhttps://bzrcdn.openai.comandhttps://bzr.openai.com, stops the pixel. OpenAI lists the exact sources to add. - Publish to your custom domain, not only to the
webflow.iostaging domain, and publish the GTM container if you changed it.
Common causes
- Consent Pro without a paid plan on the custom domain, so the banner and the scripts waiting for it never load.
- The OpenAI script is in a category the Accept button does not grant, or Consent Pro’s scan put it in a different category than the attribute says.
- Code reads consent only in Consent Pro’s ready callback and never listens for
consentpro:consent-updated, so a first-time visitor who clicks Accept stays blocked until the next page. - The page view was sent before consent and is not replayed.
- Scripts are still marked for a consent tool that was removed (for example
type="fs-cc"after moving to Consent Pro). - The OpenAI tag in GTM has only a page view trigger and no trigger for the consent event.
How to verify the fix
- In a fresh private window on the published custom domain: no measurement events before Accept, and a
page_viewedevent within a few seconds after Accept, on the same page. - Open another page as a returning visitor who already accepted:
page_viewedleaves without any click. - If you have access to the Advertiser API, OpenAI’s recent-events endpoint (
GET /v1/conversions/events?pid=<PIXEL-ID>) shows a sample of events from roughly the last 15 minutes; browser events show the channelpixel_sdk. - Re-run the check on IsPixelWorking. The issue should be gone, and “OpenAI Pixel fires before cookie consent” should not appear in its place.
Sources
- OpenAI Developers, Measurement Pixel (consent commands, stored denial, blocked events are not replayed, Content Security Policy sources, debug option): https://developers.openai.com/ads/measurement-pixel
- OpenAI Developers, Conversion Tracking (Monitoring Events,
pixel_sdkchannel): https://developers.openai.com/ads/conversion-tracking - OpenAI on GitHub, Ads Measurement Pixel GTM template (no consent field): https://github.com/openai/ads-measurement-pixel-gtm-template
- Stape, OpenAI Ads Pixel tag for web GTM (Consent Granted): https://stape.io/helpdesk/documentation/openai-ads-pixel-tag
- Webflow Help, Custom code in head and body tags (page code appears after site-wide code): https://help.webflow.com/hc/en-us/articles/33961357265299-Custom-code-in-head-and-body-tags
- Webflow Help, Localize page settings (custom code per locale): https://help.webflow.com/hc/en-us/articles/33961235760531-Localize-page-settings
- Webflow Help, Integrate Consent Pro for consent management (paid plan needed on custom domains): https://help.webflow.com/hc/en-us/articles/34394790067859-Integrate-Consent-Pro-for-consent-management
- Webflow Help, Install and use the OneTrust app (Blocked Scripts): https://help.webflow.com/hc/en-us/articles/49624805369491-Install-and-use-the-OneTrust-app
- Consent Pro Docs, Migration (app-assigned category takes precedence over
fs-consent-categories): https://docs.consentpro.com/webflow/migration - Consent Pro Docs, Async script loading (callback queue runs after Consent Pro initializes, blocked scripts load once consent is granted): https://docs.consentpro.com/runtime/script-loading
- Consent Pro Docs, JavaScript API reference (
consentpro:consent-updatedevent): https://docs.consentpro.com/runtime/api - Consent Pro Docs, Google Tag Manager setup (
consent-updatedCustom Event trigger): https://docs.consentpro.com/webflow/google-tag-manager - Finsweet Cookie Consent README (legacy
type="fs-cc"): https://cdn.jsdelivr.net/npm/@finsweet/cookie-consent@1/README.md - Cookiebot Support, Conditionally loading tags in Google Tag Manager (
cookie_consent_marketing): https://support.cookiebot.com/hc/en-us/articles/4417455460114-Conditionally-loading-tags-in-Google-Tag-Manager - Google Tag Manager Help, Tag Manager consent mode support: https://support.google.com/tagmanager/answer/10718549