Fix guide · Any website · medium · about 30 min
OpenAI Pixel not firing after cookie consent: how to fix it
For the finding “OpenAI Pixel does not fire after consent”. Also for: Shopify, WordPress, Webflow, Framer.
What this means
The OpenAI Pixel (the ChatGPT Ads Measurement Pixel) is installed on your page, 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, the campaign optimizes on little or nothing.
- You keep paying for clicks 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
bzr.openai.cominto the filter box. - Load the page and click Accept (accept all) on the cookie banner.
- Wait about 5 seconds. Click the requests to
bzr.openai.comand look at the payload: it carries a list ofevents, each with atype. You should see at least one event with the typepage_viewed(or another event your site sends on page load). Anything that is not one of your event names does not count: at the time of writing the SDK also sends its own, undocumented service messages (types starting withopenai::oroai::). - If no measurement event appears, the pixel is not firing after consent. Click to another page: if events appear only there, the pixel starts on the next page view, so you lose the first page of every new visit, which is usually the page your ad points to.
- In the Console tab, type
typeof oaiq."undefined"means the pixel code never ran on this page."function"only means the snippet ran: it creates a queue before the SDK arrives. 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.
How to fix
The pixel is installed, but 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 page: 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 the pixel’s consent command, check both halves:
-
something must call
oaiq("consent", true)when the visitor accepts, on the same page, and on later pages for visitors who accepted earlier. A common mistake is callingoaiq("consent", false)on every page load andoaiq("consent", true)only inside the banner’s click handler, so returning visitors stay blocked forever; -
after switching consent on, send the page view again. OpenAI says events blocked while consent is
falseare not replayed: apage_viewedsent while the banner was open is gone. Send it afteroaiq("consent", true), or wait with allmeasurecalls until consent is known:function onMarketingConsent() { oaiq("consent", true); oaiq("measure", "page_viewed", { type: "contents" }); } -
a denial can also come from the pixel itself: OpenAI says the pixel keeps consent
falsewhen it finds a stored denial. A visitor (or you, while testing) who rejected earlier stays blocked until your code callsoaiq("consent", true)after they change their mind.
-
- Check which category the pixel belongs to. If your consent tool blocks the script until consent, the OpenAI snippet must be in the category that “Accept” grants, usually marketing, and the category label must be 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 OpenAI 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 has 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;
- with Stape’s OpenAI Ads Pixel template, check its Consent Granted field: if it is set to
false, the tag holds events until the tag fires again with consent granted. OpenAI’s own GTM template has no consent field; it relies on the tag’s Consent Settings and triggers.
- open GTM’s Preview mode, load the site and click Accept. A consent update should appear, with
- Look at the browser console for errors. A JavaScript error in custom code before the
measurecall stops the event. A Content Security Policy that does not allowhttps://bzrcdn.openai.cominscript-srcandhttps://bzr.openai.cominconnect-srcblocks the pixel; the console shows a CSP violation. OpenAI lists the exact sources to add. - Check the event call itself. The event data object needs a
typethat matches the event (for example{ type: "contents" }forpage_viewed), andamountandquantitymust be whole numbers. Withdebug: truein theinitcall on a test copy of your site, the SDK logs what it does in the console. - Publish your changes and clear any cache.
Common causes
- Consent is withdrawn with
oaiq("consent", false)on every page load, and only the banner click switches it back on, so returning visitors who accepted earlier send nothing. - The page view was sent before consent and is not replayed afterwards.
- 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 SDK.
- The Pixel ID in the code is wrong (events would still be sent, but to another data source; check
pidin the request address once events appear).
How to verify the fix
- In a fresh private window: no measurement events before Accept, and a
page_viewedevent within a few seconds after Accept, on the same page. - Reload the 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 (
oaiq("consent", false | true), stored denial, blocked events are not replayed), Content Security Policy sources, debug option, troubleshooting: https://developers.openai.com/ads/measurement-pixel - OpenAI Developers, Supported Events (event names and data shapes): https://developers.openai.com/ads/supported-events
- OpenAI Developers, Conversion Tracking (Monitoring Events,
pixel_sdkandserver_to_serverchannels): https://developers.openai.com/ads/conversion-tracking - Stape, OpenAI Ads Pixel tag for web GTM (Consent Granted, GTM consent mode support): https://stape.io/helpdesk/documentation/openai-ads-pixel-tag
- Google Tag Manager Help, Tag Manager consent mode support: https://support.google.com/tagmanager/answer/10718549