How to Preserve OpenAI Ads Attribution with UTM Parameters
OpenAI Ads attribution depends on the oppref parameter surviving from ad click to landing page. Here's how that chain works, the six things that break it, and how to protect it, including for server-side CAPI events.
When your paid ad campaigns drive sales that show up in your reports as Direct or Unassigned, your attribution parameters are usually getting stripped midway through the funnel.
Trailing-slash redirects, canonical domain rewrites, cookie consent modals, and third-party checkout gateways frequently wipe query parameters from landing URLs. The moment your tracking token vanishes before the client script initializes, campaign attribution breaks completely.
Understanding how attribution tokens travel through your site allows you to configure server redirect rules and session storage so every ad dollar gets credited to the right campaign.
How attribution tokens flow
OpenAI Ads attributes conversions through a sequential chain of client and server touchpoints:
First, a visitor clicks an ad in ChatGPT. The platform automatically appends an oppref query parameter to the destination URL.
Second, the shopper lands on your site with the parameter attached to the query string.
Third, the base pixel initializes, reads oppref from the address bar, and stores it in a first-party __oppref cookie with a 30-day lifespan.
Fourth, future browser events (contents_viewed, items_added, order_created) read this cookie and attach the token to outbound telemetry.
Fifth, for server-side Conversions API (CAPI) events, this handoff does not happen automatically. Server requests do not have browser cookies attached, so your application backend must read the __oppref cookie during the customer's browsing session, store it against the cart or order record, and forward it explicitly in CAPI payloads.
If a redirect wipes the query string between the initial ad click and page load, the pixel never sees the token, the cookie is never written, and attribution is lost forever.
Common parameter-stripping failure points
1. Web server and CDN redirect chains
A classic misconfiguration occurs when your ad links point to /landing, which redirects via HTTP 301 to /landing/ (adding a trailing slash) or a localized subfolder. If your Nginx, Apache, or Cloudflare rule drops query strings during the rewrite, oppref and your UTM tags disappear before the HTML ever reaches the browser.
Audit your server rewrite rules and confirm that target URLs append $is_args$args (in Nginx) or preserve query strings across all rewrite hops.
2. Cookie consent walls and location gates
If your cookie consent banner or country selector redirects visitors to a different URL instead of rendering an in-place modal overlay, that transition acts as a fresh navigation. Unless the redirect URL copies query parameters forward, the attribution token gets lost.
Configure consent prompts to render as DOM overlays on the current page instead of redirecting to separate landing URLs.
3. Canonical domain redirects
Enforcing HTTPS or canonical domain rules (example.com to www.example.com) often strips query strings if redirect rewrites use static destination strings.
Confirm that your canonical HTTPS redirect rules append request query strings instead of redirecting to bare root URLs.
4. Link shorteners and vanity redirects
Using third-party URL shorteners or custom redirect scripts can strip parameters if the redirect engine fails to forward query parameters to the destination URL.
Avoid chaining shorteners on paid ad destinations, or verify that the shortening platform explicitly passes all query parameters through to the final target.
5. Aggressive URL sanitization plugins
WordPress and CMS plugins designed to clean URLs for SEO often strip tracking parameters aggressively. Verify that your CMS plugins exclude oppref and standard UTM tags from automatic parameter stripping.
Distinguishing UTM parameters from oppref
UTM tags (utm_source, utm_medium, utm_campaign) exist to categorize traffic inside your own web analytics platforms (such as GA4).
The oppref parameter is an OpenAI-specific click token designed exclusively to attribute conversions inside OpenAI Ads Manager.
These systems operate independently. Your web analytics can report campaign traffic correctly while Ads Manager reports zero conversions if the oppref token was dropped while UTM tags survived. Your URL and redirect configurations must preserve both sets of parameters.
Forwarding oppref in server-side CAPI payloads
Because OpenAI's Conversions API does not extract client-side cookies automatically, your application must carry the token across the checkout lifecycle:
- Read the
__opprefcookie on incoming web requests during the visitor session. - Store the string in your session state or cart attributes.
- When the order completes, write the token to your database order record.
- In your backend CAPI webhook dispatcher, include the stored value in the event payload:
{
"id": "order_48213",
"type": "order_created",
"timestamp_ms": 1754812800000,
"action_source": "web",
"source_url": "https://shop.example.com/checkout/confirmation",
"data": {
"type": "contents",
"amount": 8998,
"currency": "USD",
"oppref": "OPPREF_TOKEN_FROM_INITIAL_VISIT"
}
}
Detailed schema requirements are documented in OpenAI's Conversions API documentation.
Verifying attribution persistence
Test your attribution pipeline before running paid campaigns:
- Generate a test URL with appended test parameters:
https://yourstore.com/products/item?oppref=test_token_123&utm_source=chatgpt. - Navigate to the link and inspect the browser address bar to verify the parameters survived all server redirect hops.
- Open browser developer tools, navigate to the Application or Storage tab, and verify that the
__opprefcookie containstest_token_123. - Trigger a conversion event and inspect the outbound POST to
bzr.openai.comto confirm the parameter is attached. - If using server CAPI, complete a test order and inspect backend execution logs to verify that the outgoing CAPI payload includes the forwarded
oppreftoken.
Tracing parameter survival from ad click to backend payload ensures your conversion data maps directly back to the campaigns driving real revenue.
Rather than hunting through storage tabs manually, you can check live __oppref cookie status and test URL parameter survival immediately using the OpenAI Ads Pixel Helper Chrome extension.
Shopify merchants running these tracking patterns can deploy the Theme App Embed, sandboxed Web Pixel, _oppref cart bridge, and AES-GCM-256 encrypted Conversions API pipeline automatically using our free Y OpenAI Ads Pixel ChatGPT Ads app.
Need ChatGPT tracking installed?
Configured, tested, documented.