OpenAI pixel (OAIQ) setup for ChatGPT Ads
install the OpenAI pixel, the oaiq snippet, add measure calls for real conversions, keep oppref alive through redirects, and test before you spend.
last updated 5 November 2026
the OpenAI pixel is the JavaScript snippet that tracks conversions for ChatGPT Ads, and oaiq is
its function name. you install it inside the <head> of every page, initialised with the Pixel ID
from the Conversions section of Ads Manager. it fires a page_viewed event on its own. every real
conversion, a purchase, a sign-up, a lead, needs an oaiq("measure", ...) call that you add
yourself on the page where that action completes. without those calls you have a working pixel and
no conversion data.
Why it goes in before the campaign
the Conversions objective needs a working standard event to exist before you can build the campaign, and delivery is optimised toward the signals you send. a pixel installed the morning of launch is how you get a campaign that spends without learning, because the system is optimising against signals that are not arriving yet. install it, test it, then create campaigns.
Setup, step by step
- open the Conversions section of Ads Manager and copy your Pixel ID.
- paste the pixel snippet inside the
<head>of every page, initialised with that Pixel ID. it firespage_viewedautomatically, so you will see activity straight away. that activity is not a conversion. - on each page where a conversion completes, add a
measurecall with the event and, where one exists, a value:
oaiq("measure", "purchase", { value: 49.00, currency: "USD" });
- keep the event list short and tied to money: a sign-up, a trial start, a purchase. only standard events can drive optimisation, custom events cannot, so check which events your account lets you select before you build around one.
- send a
valuewherever one exists. optimising toward “a conversion” treats a ₹50 order and a ₹5,000 order identically, which is only right if your product has one price. - make sure
opprefsurvives every redirect between the ad and the conversion (next section). - fire a real test conversion and confirm it appears in Ads Manager before you spend anything.
Keep oppref alive
when someone clicks your ad, OpenAI appends a click reference called oppref to your landing page
URL, something like ?oppref=gAAAAAb123. the pixel reads it and stores it in a first-party cookie,
so a conversion that happens three pages later can still be tied back to the click.
the most common way this breaks is a redirect that drops the query string: a link shortener, a
locale redirect, an http to https hop. any of them throws oppref away before the pixel ever sees
it. click through your own ad path once, hop by hop, and check the parameter is still on the URL
when the page with the pixel loads.
The mistake that looks like success
installing the pixel, seeing page_viewed firing, and assuming you are done. page_viewed fires
automatically. your conversion events do not exist until you add the measure calls on the pages
where the action completes. it is easy to have a green-looking pixel and zero conversion data, and
easy not to notice for a week. check the event, not the pixel.
What the pixel does with customer data
the pixel handles automatic advanced matching. it picks up contact details from recognisable forms, normalises them and hashes them with SHA-256 in the browser before anything is sent, so raw customer information never leaves the page.
Where the pixel is not enough
the pixel runs in the browser, so it loses events to ad blockers, browser privacy changes and people who close the tab before it fires. that is what the OpenAI Conversions API is for, and running both together is the setup worth having. for places where you cannot run a script at all, such as some email and checkout flows, there is also an image tag: a no-JavaScript fallback that is useful at the edges and not a replacement for either.
Pixel checklist
- the pixel is inside the
<head>of every page. - a
measurecall sits on every page where a conversion completes. - the event you plan to optimise toward is a standard event your account can select.
- the value you send matches what you actually earn.
opprefis still on the URL after every redirect.- a real test conversion shows up in Ads Manager.
the full write-up, with the Conversions API, deduplication and the rules of the Conversions objective, is in ChatGPT Ads tracking: OAIQ pixel and OpenAI Conversions API.
next in this playbook: the OpenAI Conversions API, for the events the browser loses.
the pixel is one leg of the ChatGPT Ads playbook. if you want your tracking checked before you spend, the breakdown call is free. Let’s talk Growth.
this page is part of the ChatGPT Ads playbook.
More in this playbook
What ChatGPT Ads are and who can run them
OpenAI's ads inside ChatGPT, explained: where they appear, who sees them, how the targeting works, and what you need before a first campaign.
ChatGPT AdsOpenAI Conversions API: server side tracking
send ChatGPT Ads conversions server side with the OpenAI Conversions API, pass oppref, and stop double counting with one shared event ID.
ChatGPT AdsChoosing a ChatGPT Ads objective
Views, Clicks or Conversions: what each ChatGPT Ads objective is for, why to start on Clicks, and how app installs work with no install objective.
ChatGPT AdsChatGPT Ads attribution: measurement checklist
the checks to run before and after you spend on ChatGPT Ads: events, oppref, deduplication, MMP setup, and why Ads Manager and analytics disagree.