---
title: "OpenAI Pixel fires before cookie consent on WordPress"
description: "The ChatGPT Ads pixel on your WordPress site measures before visitors answer the cookie banner. Find what loads it and put it behind your consent plugin."
updated: "2026-10-23"
url: "https://ispixelworking.com/guides/openai.fires_before_consent/wordpress"
---

# OpenAI Pixel fires before cookie consent on WordPress

Fix guide · WordPress · medium · about 45 min · updated 2026-10-23

For the finding “OpenAI Pixel fires before cookie consent” (`openai.fires_before_consent`).
Also for: [Any website](https://ispixelworking.com/guides/openai.fires_before_consent/generic), [Shopify](https://ispixelworking.com/guides/openai.fires_before_consent/shopify), [Webflow](https://ispixelworking.com/guides/openai.fires_before_consent/webflow), [Framer](https://ispixelworking.com/guides/openai.fires_before_consent/framer).

## What this means

Your WordPress site shows a cookie banner, but the OpenAI Pixel (the ChatGPT Ads Measurement Pixel; it loads `oaiq.min.js` from `bzrcdn.openai.com`) sent events to OpenAI while the banner was still waiting for an answer. On WordPress this usually means the pixel comes from a code snippet, a theme setting or a tracking plugin that your consent plugin does not control.

It happens easily with this pixel. OpenAI's documentation says the pixel starts with consent set to `true` unless your site sets it to `false`, or the pixel finds a denial stored from an earlier visit. A snippet pasted as it is measures from the first page load. And because `bzrcdn.openai.com` is a new address, consent plugins that block known trackers automatically may not recognize it.

Why it costs you money:

- If you advertise to people in the EU, sending marketing data before consent is a legal risk you probably did not intend to take. We report the technical behaviour only; we cannot tell you whether your setup is compliant.
- The banner and the pixel are not connected. When this is fixed in a hurry, the usual result is the opposite problem: the pixel stops sending anything and ChatGPT Ads lose their conversion data.

## How to confirm it yourself

Our check runs from a browser in the EU, so the site behaves as it would for an EU visitor. If your consent plugin only shows the banner in some regions, use a VPN or ask a colleague in the EU.

1. **Log out of WordPress**, or use a **private (incognito) window**. Tracking plugins can skip logged-in users or certain roles, and optimization plugins can serve logged-in users different pages.
2. Open developer tools (F12), go to the **Network** tab and type `bzr.openai.com` into the filter box.
3. Load the page. **Do not click anything on the cookie banner.**
4. Click each request and look at its payload: a list of `events`, each with a `type`. A `page_viewed` or conversion event while the banner is open means the pixel measures before consent. The configuration file from `bzrcdn.openai.com` and service messages whose type starts with `openai::` or `oai::` are housekeeping and do not count (at the time of writing the SDK sends these on its own; OpenAI does not document them).
5. In **Application > Cookies** (Chrome) or **Storage > Cookies** (Firefox), an `__obref` cookie before you answer the banner means the pixel runs with consent switched on.

## How to fix

1. **Find every place the pixel comes from.** Right-click the page, choose *View page source* and search for `oaiq.min.js` and `oaiq(`. The usual sources on WordPress:
   - A snippet you pasted: **WPCode** (**Code Snippets > Header & Footer**), Elementor Pro's **Custom Code** (**Elementor > Custom Code**), a theme's header code field, or a `wp_head` function in a child theme.
   - A tracking plugin. There is no OpenAI plugin; third-party plugins install the pixel: PixelYourSite (free and Pro), Pixel Manager for WooCommerce (browser pixel in the free version), and smaller ones such as Measurement Pixel for OpenAI Ads and PixelBridge.
   - A Google Tag Manager (GTM) container, added by Site Kit by Google, GTM4WP or a theme snippet, with OpenAI's own GTM template, Stape's **OpenAI Ads Pixel** tag or a Custom HTML tag.
2. **Keep one source and remove the others.** A second copy usually sits outside your consent setup and also sends every event twice (see "Duplicate OpenAI events").
3. **Put that source under your consent plugin's control.**

**A pasted snippet (WPCode, Elementor, theme):** the simplest fix is to let your consent plugin hold back the whole snippet until the visitor accepts marketing cookies. Mark it by hand; do not count on automatic blocking.

- **Complianz:** under **Complianz > Integrations**, add a **Script Center** entry in the **marketing** category that blocks by URL (`bzrcdn.openai.com`) or by text (`oaiq`). Complianz's built-in service list has no OpenAI entry.
- **CookieYes:** in the **Cookie Manager**, open the **Advertisement** category, click **+ Add Cookie** (for `__oppref` and `__obref`) and enter `bzrcdn.openai.com` as the **Script URL Pattern**. The `data-cookieyes` attribute only applies to scripts loaded with a `src`; OpenAI's snippet is inline.
- **Cookiebot:** in manual mode, change the snippet's opening tag to `<script type="text/plain" data-cookieconsent="marketing">`. Automatic mode blocks what Cookiebot's scans find (before the first scan, only a list of known trackers); check after a scan whether it caught the pixel.

Put the page view inside the same snippet, after `init`, so it leaves as soon as the consent plugin releases the code: `oaiq("measure", "page_viewed", { type: "contents" });`. The snippet sends nothing by itself.

**Developers: the pixel's own consent command.** Consent plugins that support the WP Consent API (its plugin page lists Complianz, Cookiebot, CookieYes and others) save the visitor's choice in a cookie, by default `wp_consent_marketing`, and fire a `wp_listen_for_consent_change` event when it changes. With the WP Consent API plugin active, you can wire the pixel to it:

```html
<script>
  (function (w, d, s, u) {
    if (w.oaiq) return;
    var q = function () { q.q.push(arguments); };
    q.q = [];
    w.oaiq = q;
    var js = d.createElement(s);
    js.async = true;
    js.src = u;
    var f = d.getElementsByTagName(s)[0];
    f.parentNode.insertBefore(js, f);
  })(window, document, "script", "https://bzrcdn.openai.com/sdk/oaiq.min.js");

  // Marketing consent given earlier? Ask the WP Consent API; read its
  // cookie only if the API's script has not loaded yet.
  var oaiOk = typeof window.wp_has_consent === "function"
    ? wp_has_consent("marketing")
    : /(?:^|;\s*)wp_consent_marketing=allow/.test(document.cookie);
  oaiq("consent", oaiOk);
  oaiq("init", { pixelId: "<YOUR-PIXEL-ID>" });
  if (oaiOk) oaiq("measure", "page_viewed", { type: "contents" });

  document.addEventListener("wp_listen_for_consent_change", function (e) {
    var choice = e.detail.marketing;
    if (choice === "allow" && !oaiOk) {
      oaiOk = true;
      oaiq("consent", true);
      oaiq("measure", "page_viewed", { type: "contents" });
    } else if (choice === "deny" && oaiOk) {
      oaiOk = false;
      oaiq("consent", false);
    }
  });
</script>
```

`wp_has_consent("marketing")` applies the WP Consent API's own rules for the visitor's region (for example, opt-out regions where no cookie means consent). The WP Consent API loads its script in the footer, so the function only exists if this snippet runs after it; check the order in the page source. Otherwise the code falls back to the cookie, which ignores those rules and counts only an explicit `allow`. The code reads the stored choice instead of calling `oaiq("consent", false)` on every page, because OpenAI says that call deletes the pixel's cookies, including `__oppref` with the ChatGPT ad click. Each consent plugin also has its own JavaScript events (Complianz `cmplz_enable_category`, Cookiebot `CookiebotOnConsentReady`, CookieYes `cookieyes_consent_update`) if you prefer those.

**A tracking plugin:**

- **PixelYourSite:** in its consent settings, switch on the integration for your consent plugin (it lists ConsentMagic, Cookiebot, Cookie Notice, CookieYes and Real Cookie Banner). Its Cookiebot category fields name Meta, Google, Pinterest, Bing and TikTok, not OpenAI, so test the result. Complianz's PixelYourSite integration blocks PixelYourSite's own scripts as marketing. Developers can use the `pys_disable_openai_by_gdpr` filter.
- **Pixel Manager for WooCommerce:** its OpenAI documentation says it loads the pixel only after marketing consent. Its consent overview says the default Implicit Consent Mode fires pixels right away; since version 1.70.0 (October 2026), that mode follows the pre-decision state of opt-in banners from Complianz, Cookiebot, CookieYes and others. Update the plugin; in Pro you can switch on **Enable Explicit Consent Mode** under **Consent > Explicit consent**.
- **Measurement Pixel for OpenAI Ads:** its plugin page says the pixel and server events wait for marketing consent through the WP Consent API, so it needs a consent plugin that supports it.
- **PixelBridge:** its plugin page lists three consent modes: the WordPress Consent API, manual JavaScript or PHP consent, and unmanaged tracking after an explicit acknowledgement. Choose the WP Consent API (with a consent plugin that supports it) or connect the manual mode to your consent plugin. In the unmanaged mode, PixelBridge leaves consent to you.

**GTM:** in the OpenAI tag's **Advanced Settings > Consent Settings**, choose **Require additional consent for tag to fire** and add `ad_storage`. This only works if your consent plugin sends Google Consent Mode updates. OpenAI's GTM template makes no consent call of its own.

4. **Check caching and optimization plugins.** Consent plugins recognize scripts by URL or code; once WP Rocket, LiteSpeed Cache or Autoptimize merges the snippet into a combined file, they may not (Complianz documents this). Exclude `bzrcdn.openai.com`, `oaiq` and your consent plugin's scripts from combining and delaying, then clear every cache: plugin, host and CDN.
5. **Check the banner's mode and regions.** For EU visitors it must ask first (opt-in), not just show a notice.
6. **Make sure "Accept" starts the pixel on the same page.** See "OpenAI Pixel does not fire after consent" and the [WordPress guide for it](https://ispixelworking.com/guides/openai.not_firing_after_consent/wordpress).

## Common causes

- OpenAI's snippet was pasted into WPCode, Elementor or the theme unchanged, so every visitor counts as consenting.
- The consent plugin relies on automatic blocking, which does not know `bzrcdn.openai.com`.
- A tracking plugin loads the pixel, and its consent integration is off or does not cover OpenAI.
- An optimization plugin merged the snippet into a combined file the consent plugin no longer recognizes.
- The OpenAI tag in GTM has no consent requirement.

## How to verify the fix

1. Clear all caches. Logged out, in a private window: no `page_viewed` or conversion events before you answer the banner, and no `__obref` cookie.
2. Click "Accept": a `page_viewed` event leaves within a few seconds, on the same page.
3. In a fresh private window, click "Reject": no measurement events at all.
4. Re-run the check on IsPixelWorking. The issue should be gone, and "OpenAI Pixel does not fire after consent" should not appear in its place.

## Questions people ask

### Is there an official OpenAI plugin for WordPress?

No. OpenAI documents the snippet, a GTM template on GitHub and the Conversions API. The WordPress plugins that install the pixel are third-party.

### Does my consent plugin block the OpenAI pixel automatically?

Do not count on it. Complianz has no OpenAI service, Cookiebot blocks what its scans have found, and CookieYes does not say whether it recognizes `bzrcdn.openai.com`. Mark the snippet by hand.

## Sources

- OpenAI Developers, Measurement Pixel (installation snippet, consent default `true`, stored denial, `oaiq("consent", false)` removes `__oppref` and `__obref`, blocked events not replayed): https://developers.openai.com/ads/measurement-pixel
- OpenAI on GitHub, Ads Measurement Pixel GTM template (no consent call): https://github.com/openai/ads-measurement-pixel-gtm-template
- WPCode, How to add header and footer code in WordPress: https://wpcode.com/how-to-add-header-and-footer-code-in-wordpress/
- Elementor, Add custom code (Elementor > Custom Code, location): https://elementor.com/help/custom-code-pro/
- PixelYourSite, OpenAI Pixel for WordPress (free and Pro, consent filter): https://www.pixelyoursite.com/openai-pixel
- PixelYourSite, ConsentMagic and other WordPress consent plugins: https://www.pixelyoursite.com/docs/consentmagic-integration
- PixelYourSite, Consent filters for developers (`pys_disable_openai_by_gdpr`): https://www.pixelyoursite.com/docs/consent-filters-hooks
- SweetCode, Pixel Manager: OpenAI (consent): https://sweetcode.com/docs/pmw/plugin-configuration/openai
- SweetCode, Pixel Manager: Privacy and consent overview (Implicit and Explicit Consent Mode): https://sweetcode.com/docs/pmw/consent-management/overview/
- WordPress.org, Pixel Manager for WooCommerce (OpenAI pixel, 1.70.0 changelog): https://wordpress.org/plugins/woocommerce-google-adwords-conversion-tracking-tag/
- WordPress.org, Measurement Pixel for OpenAI Ads (pixel and server events wait for marketing consent through the WP Consent API): https://wordpress.org/plugins/measurement-pixel-for-openai-ads/
- WordPress.org, PixelBridge: ChatGPT Ads Pixel Tracking (three consent modes; measurement does not start if the WP Consent API is selected but unavailable): https://wordpress.org/plugins/pixelbridge-ads-tracking-for-openai/
- WordPress.org, WP Consent API (supporting consent plugins, `wp_listen_for_consent_change`): https://wordpress.org/plugins/wp-consent-api/
- WP Consent API source, `wp-consent-api.js` (cookie name `wp_consent_` plus category; `wp_has_consent` and its consent-type rules): https://plugins.svn.wordpress.org/wp-consent-api/trunk/assets/js/wp-consent-api.js
- WP Consent API source, `api-functions.php` (the script is enqueued in the footer): https://plugins.svn.wordpress.org/wp-consent-api/trunk/inc/api-functions.php
- Complianz, Integrations: Script Center: https://complianz.io/help/wordpress/configuration/integrating-plugins/
- Complianz plugin source, built-in services and the PixelYourSite integration: https://plugins.svn.wordpress.org/complianz-gdpr/trunk/integrations/
- Complianz, Developers guide (`cmplz_enable_category`): https://complianz.io/help/wordpress/configuration/developers-guide-for-third-party-integrations/
- Complianz, Does Complianz work with caching plugins?: https://complianz.io/help/wordpress/configuration/does-complianz-work-with-caching-plugins/
- CookieYes, How to implement prior consent (Script URL Pattern, `data-cookieyes`): https://www.cookieyes.com/documentation/implement-prior-consent-using-cookieyes/
- CookieYes, Meta Pixel consent mode (`cookieyes_consent_update`): https://www.cookieyes.com/documentation/facebook-pixel-consent-mode/
- Cookiebot, Manual implementation (`type="text/plain"`, `data-cookieconsent`): https://www.cookiebot.com/en/manual-implementation/
- Cookiebot, Developer documentation (`CookiebotOnConsentReady`): https://www.cookiebot.com/en/developer/
- Cookiebot Support, How does auto-blocking work? (scans, known trackers before the first scan): https://support.cookiebot.com/hc/en-us/articles/11438730619804-How-does-auto-blocking-work
- Google Tag Manager Help, Tag Manager consent mode support: https://support.google.com/tagmanager/answer/10718549
