How do I track conversions from ChatGPT ads?

TofuAnswer by the Tofu team · checked

Aerial view of a single line of footprints crossing smooth, pale sand on a diagonal

Use OpenAI's Measurement Pixel on your site and its Conversions API on your server, with one shared event ID so each lead counts once. Then create a conversion event setting for that event, such as lead_created, and attach it to your campaigns. Check arrivals with OpenAI's recent-events endpoint, which labels browser events pixel_sdk and server events server_to_server. Allow at least a day before conversions show in reports, and attach the setting before launch: goal reporting counts only from when you attach it.

Ask Tofu next

Pick a question and Tofu Ads Agent answers it in chat.

As of November 2026.

Before you start

  • Access to conversion setup. You create a Pixel ID and a Conversions API key in the conversions tab of Ads Manager. OpenAI says pixel and key creation must be enabled for the ad account; if those API endpoints return 404 with Not found, contact your OpenAI partner representative.
  • A developer who can edit your site's <head> (or your tag manager) and your form handler.
  • One standard event per action. OpenAI's list includes lead_created, appointment_scheduled, registration_completed and trial_started. Our page on whether ChatGPT ads are worth testing for B2B covers which fits a form or a demo.

Step 1: Create a Pixel ID

In Ads Manager, open the conversions tab and create a Pixel ID. Search Engine Roundtable places the tab under Tools > Conversions; OpenAI's help page on it couldn't be read to confirm the path.

Every setup needs a Pixel ID, even a server-only one. When you use both the Pixel and the Conversions API on one website, reuse the same data source. Through the API, creating a pixel returns pixel_id (for sending events) and id (for picking the source in Step 5).

Step 2: Install the Measurement Pixel

Paste OpenAI's snippet near the top of the <head> on every page where a conversion can happen. It loads oaiq.min.js from bzrcdn.openai.com and calls oaiq("init", { pixelId: "..." }). Add debug: true to the init call while you test; it logs Pixel activity to the browser console.

When the form succeeds, send the event with your own event ID:

oaiq("measure", "lead_created", { type: "customer_action" }, { event_id: "lead_8F2K19" });

Three things to set up now:

  • Consent. Call oaiq("consent", false) before init, then oaiq("consent", true) once the visitor agrees. Events blocked while consent was false are not replayed.
  • Content Security Policy. If your site has one, allow https://bzrcdn.openai.com in script-src and connect-src, and https://bzr.openai.com in connect-src and img-src.
  • The click ID. The Pixel reads oppref from the landing page URL and stores it in a first-party __oppref cookie for 30 days. It also sets an __obref browser reference cookie for 365 days. The Pixel sets them only while consent is granted, and oaiq("consent", false) removes both. Both are on your domain, so a booking step on another company's site won't see them; fire the event on your own thank-you page or from your server.

Google Tag Manager. OpenAI's developer docs don't cover it, but OpenAI publishes a GTM web tag template on GitHub (openai/ads-measurement-pixel-gtm-template) that you import under Templates; its README says it isn't in the Community Template Gallery yet. Stape, a third party, also publishes open-source templates: "OpenAI Ads Pixel by Stape" for web containers (in the GTM Template Gallery, with Google Consent Mode support) and a Conversions API tag for server-side containers. Or paste OpenAI's snippet into a Custom HTML tag.

Step 3: Send the same lead from your server

Create a Conversions API key in the same conversions tab. It is separate from your Advertiser API key; keep both on your server. Then post events to https://bzr.openai.com/v1/events?pid=<PIXEL-ID> with the key as a Bearer token:

{
  "events": [{
    "id": "lead_8F2K19",
    "type": "lead_created",
    "timestamp_ms": 1794153600000,
    "action_source": "web",
    "source_url": "https://www.example.com/demo/thanks",
    "oppref": "<value from the landing URL or __oppref cookie>",
    "user": {
      "obref": "<value of the __obref cookie>",
      "emails_sha256": ["<SHA-256 of the trimmed, lowercased email>"],
      "ip_address": "203.0.113.1",
      "user_agent": "Mozilla/5.0 ..."
    },
    "data": { "type": "customer_action" }
  }]
}

What OpenAI requires and recommends:

  • oppref is on you. The Conversions API doesn't capture it. Pass it through your form, for example in a hidden field, and send it unchanged. OpenAI's tracking template example adds click_id={oppref} to landing URLs, so your CRM can also capture it from the URL.
  • obref goes inside user. Read the __obref cookie in the browser, send it to your server and pass it without hashing. Stop if the visitor withdraws consent.
  • Hash personal data. Trim and lowercase emails, then send the SHA-256 hash as 64 lowercase hex characters. Each list holds at most three values. Send IP address and user agent unhashed.
  • Timing. timestamp_ms must be within the last 7 days and no more than 10 minutes in the future. Our B2B page covers what that limit means for later pipeline stages.
  • Send every lead, not only those with an oppref. OpenAI says this lets view-through conversions count.
  • Test first. Add "validate_only": true at the top level to check a request without saving it. A batch holds up to 1,000 events, and one bad event fails the whole batch, so validate before you send in bulk.

Step 4: Use one event ID in both places

OpenAI matches duplicates on three things: the Pixel ID, the event name and the event ID (event_id in the Pixel, id in the API). For custom events, custom_event_name must match too. OpenAI keeps the first event it receives and ignores later copies.

So generate the ID once, when the form submits, and hand the same value to the Pixel and to your server. Reuse it if your server retries.

Step 5: Define the conversion and attach it to campaigns

Sending events doesn't make them conversions; a conversion event setting picks one event from one source. Through the API, create it with event_type: "lead_created", attribution_window_days: 30 (the value OpenAI's reference says to use) and source_ids set to the source's id, not its pixel_id. OpenAI's help page on the Ads Manager screens for this step couldn't be read.

Then attach the setting to each campaign in conversion_event_setting_ids. That field replaces the whole list, so include any settings you already had. Clicks and impressions campaigns can track conversions without changing their objective. A conversion-optimized campaign needs exactly one active standard event setting, and you can't change it after the campaign is created.

Step 6: Check that events arrive

  1. In the browser. With debug: true, submit a test lead and watch the console. The Network tab should show a request to bzr.openai.com.
  2. In the recent-events sample. Call GET https://api.ads.openai.com/v1/conversions/events with your pid and limit=50. It returns a sample from roughly the last 15 minutes. Check the event type, the source and the channel: pixel_sdk for the browser, server_to_server for your server. With both set up, look for your test lead under each channel. Validate-only requests don't appear here.
  3. In Event Quality Score. According to Search Engine Roundtable (September 16, 2026), Ads Manager shows a 1 to 10 setup score for eligible Pixel and Conversions API sources under Tools > Conversions, with user-data coverage and recommendations. OpenAI's help article on event quality couldn't be read to confirm the details.
  4. In reports, a day later. OpenAI says conversions update through daily processing, so allow at least one day.

Step 7: Compare numbers on the same settings

OpenAI's reporting API defaults to a 30-day click window, a 1-day view window and "ad-event time," which dates each conversion by the click or view, not by the day the lead came in. Your CRM dates leads by when they arrive. To compare, pick the same dates, set the view window to 0 and, in the API, set attribution_time_basis to conversion_time. OpenAI says to use the same dates, time basis and windows when you compare the API with Ads Manager. Search Engine Roundtable reported on September 16, 2026 that Ads Manager lets you choose a 7, 14 or 30-day click window and a 0 or 1-day view window.

OpenAI's pages disagree on one point. Its Reporting page and September 30, 2026 changelog say the API's conversions total counts click-throughs plus view-throughs; its Pixel and Conversions API pages say Ads Manager shows view-throughs separately, with Conversions staying click-through only. Check which your report uses before comparing it with Google or LinkedIn.

Common problems

ProblemWhy it happensFix
Pixel or API key creation returns 404Conversion setup isn't enabled for the accountContact your OpenAI partner representative
Server events rejectedTimestamp older than 7 days, source_url missing on a web event, more than three values in a user list, or an amount without a currencyFix the field and test with validate_only
Leads counted twiceDifferent event IDs, names or Pixel IDs on each sideGenerate one ID per lead and reuse it
Server leads rarely match an adoppref and obref aren't passedForward both, plus a hashed email
Pixel never loadsYour Content Security Policy blocks OpenAI's domainsAdd the sources from Step 2
Conversions missing for earlier daysGoal reporting counts only from when the setting was attachedAttach settings before launch
Sources (12)

Related resources