Fix guide · WordPress · medium · about 45 min

ChatGPT Ads click ID (oppref) lost on WordPress

For the finding “Click ID from OpenAI ads is not stored”. Also for: Any website, Shopify, Webflow, Framer.

What this means

When someone clicks an ad in ChatGPT, the link to your site carries an attribution identifier in the oppref URL parameter. The OpenAI Pixel (the ChatGPT Ads Measurement Pixel) should pick it up on the landing page, store it in the first-party cookie __oppref and send it with later events, so a lead or a WooCommerce order on another page can still be tied to the ad click. On your site, the click ID did not make it.

Why it costs you money:

  • Conversions lose their link to the ChatGPT ad click, so ChatGPT Ads reports fewer conversions than your ads brought.
  • Conversion-optimized campaigns learn from fewer attributed conversions.
  • If you send server events through the OpenAI Conversions API, OpenAI notes that the API does not capture oppref by itself. Your plugin or server has to pass it on, and if it is missing in the browser, it is usually missing there too.

How to confirm it yourself

Our check opens your page in a browser in the EU as if arriving from a ChatGPT ad, with a test click ID in the URL, accepts the cookie banner and looks for the click ID. If our report shows a redirect chain, start there.

  1. Log out of WordPress or use a private (incognito) window. Some plugins that remove URL parameters skip logged-in users, so you would not see the problem while logged in.
  2. Open developer tools (F12) on the Network tab and tick Preserve log, so redirects stay visible.
  3. Open the exact URL your ads use, with a made-up click ID added: https://yourdomain.com/landing-page/?oppref=test123. (This sends a normal page view to your own pixel. It does not create an ad click.)
  4. If the first request is a redirect (301, 302, 307, 308), check its Location header. Does the new address still contain oppref=test123?
  5. Accept the cookie banner, wait a few seconds, then open Application > Cookies (Chrome) or Storage > Cookies (Firefox). __oppref should hold test123, and __obref (the pixel’s browser reference) should be there too.
  6. Filter the Network tab by bzr.openai.com and open a request: the payload should carry oppref with your test value.

How to fix

The link must arrive with oppref, the pixel must run on that page with consent, and nothing may delete the cookie afterwards.

  1. Link your ads to the final address. WordPress redirects other versions of an address to its canonical one: the http or https and www or non-www version set in Settings > General (WordPress Address and Site Address), and the trailing slash your permalink structure in Settings > Permalinks uses. Use that exact address in every ad, so visitors land without a redirect.

  2. Check the Redirection plugin, if you use it (Tools > Redirection). Each redirect has a query parameter setting:

    • Exact (the default) only matches the query you entered, so an ad URL with oppref may not be redirected at all;
    • Ignore matches but drops the parameters;
    • Pass matches and passes the parameters on to the target.

    For any redirect your ads go through, choose Pass. The default for new redirects is Default query matching under Tools > Redirection > Options.

  3. Check URL cleanup in your SEO plugin. Yoast SEO’s URL cleanup option (in its Crawl optimization settings) redirects away all unregistered URL parameters. Of those, it only ever keeps gclid and utm_ parameters, so oppref is stripped. It does not remove anything for logged-in users, which is why you may not have noticed. If it is on, add oppref to the parameters you want to keep, or turn the cleanup off. Check any other SEO, security or caching plugin with a “remove query strings” or “clean URLs” option the same way.

  4. Check language redirects. WPML’s Browser language redirect (WPML > Settings > URLs and SEO) sends visitors to the version in their browser’s language, and Polylang’s Detect browser language option redirects first-time visitors of the home page. WPML redirects with JavaScript in the browser, so you see the address change rather than a 301 or 302. Test your ad URL with a browser set to another language. If the redirect drops oppref, link your ads straight to the language version your audience should land on.

  5. Check redirects outside WordPress: rules in your hosting panel or .htaccess file, your CDN, a domain forwarding service, link shorteners or campaign link tools in front of the site.

  6. Make sure the pixel runs on the landing page after consent. The pixel reads oppref from the address of the page it runs on, and OpenAI says it uses its cookies only when measurement consent is granted. If your consent plugin does not release the OpenAI code right after Accept, or an optimization plugin delays it until the visitor interacts, the pixel may only start on the next page, where the address no longer has oppref. See the WordPress guide to “OpenAI Pixel does not fire after consent”.

  7. Do not withdraw consent for visitors who already agreed. OpenAI documents that oaiq("consent", false) removes both pixel cookies, __oppref included. If your snippet calls it at the top of every page and switches consent back on a moment later, the stored click ID is deleted on every page after the landing page. Read the stored choice first, for example from the WP Consent API cookie wp_consent_marketing, and pass true straight away for visitors who accepted. The WordPress guide to “OpenAI Pixel fires before cookie consent” has a snippet that does this.

  8. Check that your consent plugin keeps the cookie. After you click Accept, __oppref should still be there on the next page.

  9. Pass the click ID to your server events. OpenAI asks you to send the original oppref string unchanged on Conversions API events, and the __obref value as user.obref in hybrid setups.

    • Pixel Manager for WooCommerce (Pro) documents that it captures oppref on the landing page, keeps it through checkout and attaches it to every Conversions API event, and sends __obref as user.obref while marketing consent is granted.
    • PixelBridge says it preserves oppref and obref. For PixelYourSite and other plugins, check their documentation or ask their support.
    • Your own code: read the value after consent, save it with the order (for example as order meta), and send it with the server event.
  10. Clear every cache (plugin, host and CDN) after changing redirects or settings, then test again while logged out.

Common causes

  • Yoast SEO’s URL cleanup (or a similar option in another plugin) redirects oppref away.
  • A redirect in the Redirection plugin is set to Ignore or Exact instead of Pass.
  • Ads link to an old page, the non-canonical domain or a short link whose redirect drops the query string.
  • A language redirect sends visitors to another URL without oppref.
  • The pixel only starts on the next page after consent, often because the consent plugin or an optimization plugin holds it back.
  • oaiq("consent", false) runs on every page, so the cookie is removed again and again.
  • The plugin or code that sends Conversions API events does not pass oppref.

How to verify the fix

  1. Repeat the test above with the exact ad URL, logged out: no redirect drops ?oppref=test123, and after accepting cookies __oppref holds test123.
  2. Open another page of the site: __oppref is still there, and the pixel’s requests still carry oppref.
  3. Re-run the check on IsPixelWorking. The issue should be gone, and the redirect chain in the report (if any) should keep the click ID.

Questions people ask

What is oppref in my URL?

It is the attribution identifier that ChatGPT ads add to the link. OpenAI’s pixel stores it in the __oppref cookie for 30 days so later conversions can be tied to the click. Do not strip it from ad landing pages.

Sources

More OpenAI guides