← Back to Insights

OpenAI Ads Conversions API: Complete Setup Guide

A practical, step-by-step walkthrough of setting up the OpenAI Ads Conversions API, from generating credentials to sending a valid test event and monitoring for errors once you're live.

2026-07-15 • Guide

Browser-side tracking alone rarely gives you an accurate count of your sales. If you have run paid ad campaigns for any length of time, you know how fragile client-side scripts are.

When a customer finishes checkout, their browser has to fetch your tracking library, run the JavaScript, and dispatch an event payload before the tab closes. If the buyer uses an ad blocker, pays through Apple Pay or PayPal without returning to your site, or browses in a mobile webview that exits immediately, that conversion hit is gone forever. Your payment processor collects the cash, your warehouse fulfills the order, but OpenAI Ads Manager records zero conversions.

The Conversions API (CAPI) fixes this by moving event reporting to your server.

Instead of hoping the customer's browser behaves, your backend sends an HTTPS POST directly to https://bzr.openai.com/v1/events the moment a sale confirms. Ad blockers cannot touch it, Safari cookie caps cannot wipe it, and early tab closures cannot stop it.

Here is how to configure OpenAI Ads CAPI, format JSON payloads, hash customer data, and deduplicate server events against browser pixel hits.

Why CAPI is essential for conversion accuracy

The client-side measurement pixel works well for top-of-funnel browsing, tracking catalog visits, and reading landing page tokens. But it requires total browser cooperation to deliver data. Safari ITP, network filters, and quick tab exits regularly disrupt client tracking.

This is not a defect in the pixel itself, it is simply how modern browsers are designed to protect user privacy. The Conversions API bypasses the client by transmitting order data directly from your application database to OpenAI's ingestion endpoints.

Our complete guide to ChatGPT Ads tracking covers the overall hybrid setup. This guide focuses on endpoints, payload formatting, authentication, and error handling.

When you should deploy server-side CAPI

Setting up server CAPI is critical in several scenarios:

When your business needs purchase telemetry (order_created) to match your real accounting books instead of browser approximations.

When your checkout flow redirects shoppers through external payment gateways where storefront scripts never run.

When you notice a steady gap between actual store orders and the conversion numbers reported in Ads Manager.

When you track mobile app activity. Events like app_installed and app_opened only exist in CAPI because they originate outside a browser window.

When you want clean, deduplicated data so ad bidding models can optimize spend against verified revenue.

Our tracking audit is designed to pinpoint conversion leaks across your existing funnels if your numbers are already out of sync.

What you need before starting

Because CAPI operates on the server layer, make sure you have:

Access to your backend codebase, order webhooks, or cloud worker runtime to dispatch HTTPS calls when transactions complete.

A Pixel ID generated in the conversions tab of OpenAI Ads Manager to pair server events with browser hits.

A Conversions API access token generated alongside your Pixel ID to authorize write access.

A mapping of your site actions to standard events such as order_created, lead_created, or registration_completed.

1. Credentials and security

Generate your Pixel ID and Conversions API key in OpenAI Ads Manager under the conversions section.

Treat this API key like a database password:

Keep the key strictly inside server environment variables or a secret manager. Never bundle it into client-side JavaScript or public theme files where curious visitors can inspect it via DevTools.

Read our guide on secure OpenAI Ads CAPI implementation for tips on keeping credentials isolated from client bundles.

2. Payload schema and data formatting

Every CAPI request is an HTTPS POST call dispatched to:

https://bzr.openai.com/v1/events?pid=<PIXEL-ID>

Include these HTTP headers:

Authorization: Bearer <API-KEY>
Content-Type: application/json

The request body contains a validate_only boolean and an events array:

{
  "validate_only": true,
  "events": [
    {
      "id": "order-48213",
      "type": "order_created",
      "timestamp_ms": 1752600000000,
      "action_source": "web",
      "source_url": "https://example.com/checkout/confirmation",
      "data": {
        "value": 12999,
        "currency": "USD",
        "order_id": "48213"
      }
    }
  ]
}

Core payload fields

The id property is required. This is the unique event identifier that OpenAI uses alongside type to deduplicate against browser pixel hits.

The type property defines the standard event name (like order_created or lead_created), or custom for bespoke actions.

The timestamp_ms field requires an epoch timestamp in milliseconds. It must fall within the past 7 days and cannot be set more than 10 minutes into the future.

The data object carries event context, including transaction value and currency.

The action_source indicates where the conversion happened: web, mobile_app, offline, or phone_call.

The source_url is required whenever action_source is set to web.

The oppref field carries the ad click attribution token. Extract this from the incoming __oppref browser cookie on your server and forward it in the payload.

The user object accepts SHA-256 hashed customer identifiers like email (em) and phone (ph) to boost ad attribution match rates.

Monetary values follow ISO 4217 minor units as integers. For example, pass 12999 to represent $129.99 USD. Sending floating decimals will cause the ingestion validator to reject the record. Every transaction value must also include its three-letter currency code.

Batch requests support up to 1,000 events, but any single invalid item will reject the whole payload. Keep validate_only: true on during testing to verify payload structure without polluting live ad reports.

Here is a test call using cURL from your terminal:

curl -X POST "https://bzr.openai.com/v1/events?pid=YOUR_PIXEL_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"validate_only": true, "events": [{"id": "order-48213", "type": "order_created", "timestamp_ms": 1752600000000, "action_source": "web", "source_url": "https://example.com/checkout/confirmation", "data": {"value": 12999, "currency": "USD", "order_id": "48213"}}]}'

Replace YOUR_PIXEL_ID and YOUR_API_KEY with your actual account credentials, using dynamic order variables in production code.

3. Validating test conversions

After your validate_only: true call returns an HTTP 200 response, send a real test conversion to confirm live ingestion:

Set validate_only to false and dispatch a test event with a recognizable ID like test-order-001.

Check the event stream in OpenAI Ads Manager under your Pixel ID. The test conversion should show up in your activity log within a few minutes.

If nothing appears, make sure the Pixel ID in your query string matches your ad account and confirm your server clock is synced with NTP to prevent timestamp rejection.

4. Production deployment and monitoring

Once test events flow smoothly, wire the dispatch call into your core order confirmation hook or payment webhook listener. Keep an eye on your server logs for unexpected HTTP status codes:

An HTTP 401 response points to an expired or malformed bearer token.

An HTTP 403 response signals a permissions mismatch between the API key and the Pixel ID.

Timestamp rejections happen when timestamp_ms drifts outside the allowed 7-day window.

Batch validation errors indicate missing required fields or unformatted currency values in one of the batched events.

Set up basic error logging and alerts so your team gets notified if CAPI requests return non-2xx status codes.

Security architecture

The Conversions API is strictly a server-to-server pipeline. The bearer token in the HTTP Authorization header carries write access to your entire conversion stream. Never dispatch CAPI calls from front-end browser JavaScript, single-page frameworks, or mobile clients where users can inspect network requests.

Browsers talk to public CDN scripts using your public Pixel ID. Server infrastructure handles CAPI dispatches using private API keys.

Detailed hardening practices are covered in our guide on secure OpenAI Ads CAPI implementation.

Event deduplication between pixel and CAPI

When running browser pixels and server CAPI together, deduplication keeps transactions from being counted twice.

OpenAI deduplicates events by matching the browser pixel's event_id with the server payload's id property under the same Pixel ID. If you track custom events, verify that the custom_event_name parameter matches across both channels.

Mismatched identifiers inflate conversion numbers and mislead your bidding algorithms. Our comparison of pixel vs. CAPI vs. done-for-you setups breaks down these architectural differences in detail.

Our team configures and validates end-to-end CAPI deployments, ensuring accurate event delivery and verified deduplication from day one.

When pairing server webhooks with a browser tag, install OpenAI Ads Pixel Helper to confirm browser events fire cleanly and verify no script is accidentally posting directly to /v1/events.

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.