The OpenAI Measurement Pixel is the browser SDK OpenAI uses to attribute website actions back to ads in ChatGPT. After someone clicks an ad, you need to know whether they bought, booked a demo, or submitted a lead. That is what conversion measurement is for.
OpenAI documents this in Conversion measurement. You create a data source in Ads Manager, then send events with the pixel, the Conversions API, or both. OpenAI matches those events to the conversion events on your campaign and the attribution window you configured.
Hardal already sends the same conversions server-side through the OpenAI Ads destination, without a client-side pixel. This guide covers the Measurement Pixel itself: when you need it, how to install it, and which events to fire.
What the OpenAI Measurement Pixel does
The pixel loads from https://bzrcdn.openai.com/sdk/oaiq.min.js. You initialize it with your Pixel ID from the conversions tab in Ads Manager, then call oaiq("measure", ...) when the conversion happens.
It does not auto-track page views. You send events yourself.
Click-through attribution uses the OpenAI click reference, oppref, which is appended to the landing URL (?oppref=...). The pixel captures it and stores it in a first-party __oppref cookie so later conversions on your site can still be attributed. Preserve oppref through redirects. If you also use the Conversions API, include oppref on server events when you have it.
View-through reporting, when it is available on the account, uses a one-day window after an eligible impression. It needs no extra pixel fields. Click-through still wins when both apply.
Install the pixel
Put this snippet as high in <head> as you can on every page where you want to capture conversions:
<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");
oaiq("init", {
pixelId: "<YOUR-PIXEL-ID>",
});
</script>
pixelId is required. debug: true logs SDK activity in the console while you test.
If a CMP is required, set consent before init:
oaiq("consent", false);
oaiq("init", { pixelId: "<YOUR-PIXEL-ID>" });
// after the user grants measurement consent
oaiq("consent", true);
When consent is false, the pixel does not send measurement pings. Blocked events are not replayed later.
Send conversion events
A measure call is: command, event name, event data, optional options.
oaiq("measure", "order_created", {
type: "contents",
amount: 2599,
currency: "USD",
});
Use a standard event whenever one matches the action. Common ones:
| Event | Data type | Typical use |
|---|---|---|
page_viewed | contents | An important page view |
contents_viewed | contents | Product or content view |
items_added | contents | Add to cart |
order_created | contents | Purchase completed |
lead_created | customer_action | Lead form submitted |
registration_completed | customer_action | Sign-up completed |
appointment_scheduled | customer_action | Demo or meeting booked |
subscription_created | plan_enrollment | Paid plan starts |
trial_started | plan_enrollment | Trial starts |
Lead example:
oaiq("measure", "lead_created", {
type: "customer_action",
});
Pass event_id in the options object only when the same conversion is also sent through the Conversions API, so OpenAI can deduplicate. Do not reuse one static ID for every click.
Optional hashed user fields (email_sha256, and the rest) go on oaiq("init", ...), not on each measure call. Automatic advanced matching can also hash supported customer fields in the browser when it is enabled in Ads Manager.
If you enforce a CSP, allow https://bzrcdn.openai.com for scripts and https://bzr.openai.com plus the CDN for connections and image fallbacks.
Pixel, Conversions API, or both
The Conversions API is the server-side path (https://bzr.openai.com/v1/events). OpenAI treats it as more reliable than the pixel alone, especially when browsers or ad blockers drop client requests.
For resilient ChatGPT Ads measurement:
- Install the OpenAI Measurement Pixel on relevant pages
- Fire
measurewhen the intended action happens - Keep
opprefthrough redirects - Send the same conversions server-side when you can, with the same
event_id
Hardal's OpenAI Ads destination is that server-side leg: first-party web events mapped to OpenAI conversions without depending on the browser pixel surviving the session.
Get started
To measure ChatGPT Ads with Hardal, request a free demo or read the OpenAI Ads destination docs and OpenAI's conversion measurement article.