Measuring ChatGPT Ads: the pixel and the Conversions API through your server container
Ads in ChatGPT come with their own measurement: a pixel, a Conversions API and a click ID called oppref. OpenAI's pixel and Stape's Conversions API tag are both in the Tag Manager gallery, and the Measurebase import wires them together with one event ID. Here is the setup.
What you need
- Pixel ID: ChatGPT Ads Manager → Conversions.
- Conversions API key: generated on the same page; it is a bearer key, so it stays in Measurebase and the server container only.
- Your Measurebase domain with the Enhanced script installed and GA4 events flowing.
Step 1 · Add it to your measurement setup
Open the domain in your dashboard, go to its Settings page and find Measurement setup. Tick the destination card and fill in the IDs below. Tokens and API keys are stored encrypted, outside the setup itself. The setup sends nothing on its own: it is the reference the tracking audit and the template builder work from, so what you fill in here is what the audit expects to find in your containers.
Step 2 · Generate and import the containers
Go to Resources → GTM templates in the dashboard. Under Destinations, tick the platform (Google Analytics 4 and the e-commerce events are on by default; pick the Shopify, WordPress or Shopware data layer if your site runs one of our plugins). Fill in the same IDs on the next step, choose Web + server under Containers and download the two JSON files.
In Google Tag Manager, open each container, go to Admin → Import Container, choose the matching file, pick a new workspace and Merge. The import only adds: new tags, triggers and variables with their own names, plus the gallery templates they need. Check the result in Preview, then publish.
Step 3 · What the import contains
Web container: OpenAI's official Ads Measurement Pixel template with the events page_viewed, contents_viewed, items_added, checkout_started and order_created, a constant with your pixel ID and the Unique Event ID variable. OpenAI expects amounts in minor units; the import converts your values.
Server container: the OpenAI Ads Conversions API template (Stape, from the gallery) as one tag that listens to every GA4 event and maps the names itself, sends hashed email, IP address and user agent with oppref and the browser reference, and sets the __oppref and __obref cookies from the server.
Step 4 · One event ID for browser and server
A platform that receives the same event from a browser pixel and from a server tag counts it twice unless both carry the same event ID. The import takes care of that: the Unique Event ID variable creates one ID per event in the web container, the GA4 event settings send it to your server container as event_id, and both the pixel tag and the server tag send that same value in their deduplication field. The platform keeps one copy and discards the other.
With the Shopify app, the WordPress plugin or the Shopware plugin, a purchase that is also forwarded server-side carries the order number as mb_event_id, so the two purchase copies can be paired as well.
OpenAI deduplicates on pixel ID, event name and event ID.
Step 5 · Consent
The imported tags carry the consent settings of the reference containers they were copied from. Check them against your own consent setup before you publish: a browser pixel should require ad_storage under Additional consent checks or fire on your consent tool's event, and the server tags should only send when the hit carries ad consent. The audit's consent checks and the guide on tags that fire before consent show how to verify both.
Step 6 · Test it
ChatGPT Ads Manager → Conversions lists events as they arrive from the pixel and the API, with the matched identifiers.
On the Measurebase side, open the domain's Request logs: a browse through your site should show GA4 events arriving at your server container with a green 200. Open the server container's Preview mode to see the server tag fire on those events, with the event ID and the user data it picked up.
Click IDs and cookies
A click from ChatGPT lands with oppref in the URL. The pixel stores it in the __oppref cookie for 30 days and keeps a browser reference in __obref for a year, both set by JavaScript and therefore capped by Safari. The ChatGPT Ads switch in Click ID Restorer captures oppref in a first-party cookie the moment the visitor lands, and the ChatGPT Ads group in Cookie Keeper re-issues both cookies with their full lifetime.
What the tracking audit checks
Every night the tracking audit compares your measurement setup with your live containers and your site. For every destination it checks that the tags exist in the container your setup expects, that the ID in the container matches the one in your setup, that a browser pixel and its server tag share an event ID, and which of the platform's cookies are still set after a visitor rejects. Findings open an alert the first time they appear; what the audit can fix, it proposes as a change in a separate Measurebase workspace in your container.
Frequently asked questions
Why not relay the pixel through my own domain like Google's hits?
Relaying a third-party pixel produces a worse-matched duplicate: the IP address becomes the relay's, and OpenAI does not route it first-party the way Google does. The blocker-proof path is the Conversions API tag, fed by the masked first-party hits.