Skip to content
PPC & Paid Advertising

OpenAI Ads Pixel Setup: 7 Steps for CAPI

Learn OpenAI Ads Pixel Setup with a practical Pixel and Conversions API guide, shared event IDs, testing steps, and common tracking fixes for developers.

SocialStardom Editorial Team10 min read
OpenAI Ads Pixel Setup: 7 Steps for CAPI

OpenAI Ads Pixel Setup connects browser activity with confirmed server events so ChatGPT Ads can measure conversions more reliably. The Pixel captures website actions, while the Conversions API, or CAPI, sends events from your server. When both report the same conversion, OpenAI uses a shared event ID to deduplicate it.

Summary

  • Use both signals: The Pixel measures browser activity, while CAPI sends server confirmed events.
  • Deduplicate events: Send the same event ID through the Pixel and CAPI for one conversion.
  • Protect credentials: Keep the Conversions API key on your server, never in browser code.
  • Test before launch: Confirm event delivery in Ads Manager before relying on conversion reports.

What is the OpenAI Ads Pixel and CAPI?

The OpenAI Ads Pixel is a browser SDK that measures website events and sends them to OpenAI, while the Conversions API is a server to server method for sending events after your backend confirms an action. Using both can improve measurement coverage, provided duplicate events share the same event ID. OpenAI's Conversion Measurement guide explains that a conversion must be received from a connected data source, match the campaign's configured event, fall within the attribution window, and connect to an eligible ad interaction.

The Pixel is useful for actions that happen in the browser, such as a form submission or checkout interaction. CAPI is useful when your server knows that an order, registration, or lead was actually completed. OpenAI's Conversions API documentation describes CAPI as a server to server integration that can improve delivery control, retries, and matching with supported identifiers.

For an Indian business, that difference matters when a customer moves through redirects, embedded forms, payment pages, or a CRM. A browser event may fire before the backend confirms the result. The server event can represent the confirmed outcome, while the shared ID prevents OpenAI from counting both as separate conversions.

What you need before setup

You need an active Ads Manager account, a web conversion source, an Advertiser API key for setup, and a Conversions API key for server event delivery. You also need access to the website code or tag manager, access to the backend that confirms conversions, and a defined list of events to measure.

OpenAI's Conversion Tracking documentation separates the identifiers used during setup. The returned pixel_id initializes the browser Pixel and is also used in server events. The source id identifies the data source when you create a conversion event setting.

Choose one primary conversion first. A completed purchase, submitted lead, or completed registration is usually easier to validate than a collection of soft actions. Add other permitted events after the first event is working and attached to the correct campaign.

Your event plan should also identify the system of record. For example, a website form can create a lead in your CRM, but your CRM or backend should generate the stable event ID if that is where the completed action becomes final.

How to complete OpenAI Ads Pixel Setup

The setup follows seven practical steps. Create the source, install the browser code, define events, create server credentials, send matching events, attach the conversion, and test the complete journey. The endpoint names and field relationships below come from OpenAI's Conversion Setup API reference.

  1. Create a web source. In Ads Manager, open the conversions area and create a web data source. If you use the API, create a source with client_type set to web. Save both the returned pixel_id and source id.

  2. Install the Pixel. Add OpenAI's JavaScript snippet near the top of the <head> on pages where conversions can occur. Initialize the SDK with the correct pixelId. OpenAI's Measurement Pixel guide says that the Pixel sends an event when you call oaiq("measure", ...).

  3. Map conversion events. Select standard events that match the real action, such as order_created for a completed purchase or registration_completed for a completed registration. Use a custom event only when no standard event fits the action.

  4. Create event settings. Define the conversion event in Ads Manager or through the conversion setup API. Use the source id, not the browser pixel_id, when selecting the data source for the event setting. Attach the setting to the campaign you want to measure.

  5. Create the CAPI key. Generate a Conversions API key for server delivery. Keep the key in server-side secret storage. Do not place it in JavaScript, a public repository, a browser request, or a page source.

  6. Send the server event. When your backend confirms the action, send the event to OpenAI with the Pixel ID, event name, timestamp, event data, and a unique event ID. Include eligible attribution and matching fields when permitted and available.

  7. Reuse the event ID. Send the identical event ID from the browser and server for the same conversion. OpenAI's conversion setup documentation states that a shared event ID lets OpenAI process the browser and server reports as one event.

The browser call can look like this after a purchase completes:

javascript oaiq("measure", "order_created", { type: "contents", amount: 8900, currency: "USD" }, { event_id: "order_12345" });

The example uses an amount in a currency's standard minor unit, as specified by OpenAI's Supported Events documentation. Use the actual order identifier or another stable unique identifier. The server must reuse that same identifier when it reports the confirmed purchase.

If your business receives enquiries rather than online orders, send the event when the form is accepted by your backend or CRM. A click on the submit button is not the same as a confirmed lead. SocialStardom's enquiry follow-up automation can help connect website enquiries to a follow-up process, but your developer still needs to define the conversion's source of truth.

Pixel and CAPI fields to align

The most important implementation rule is consistency. The Pixel and CAPI payloads should describe the same action, source, and conversion identity, while sensitive credentials remain server-side.

Area Browser Pixel Conversions API What must match
Source pixelId Pixel ID in the request Use the same web source
Event oaiq("measure", ...) Server event name Use the same event type
Identity event_id Server event ID Reuse one unique ID
Evidence Browser action Backend confirmation Describe one conversion

OpenAI's Conversions API guide also documents obref, the browser reference stored by the Pixel, as a field that can be forwarded to CAPI when available. Read the value in the browser, send it to your server, and include it unchanged in the server event. Follow your consent requirements before collecting or forwarding it.

Preserve the OpenAI click reference when your site changes URLs or passes through a redirect. OpenAI's conversion measurement guidance calls this reference oppref and explains that the Pixel captures it from the landing page URL for later measurement.

For monetary events, send an integer amount in the standard minor unit for the currency code. Do not send a currency amount that uses one format in the Pixel and another format in CAPI, because inconsistent values make debugging and reporting harder.

Around the middle of this implementation, review your landing page and measurement path together. SocialStardom's website and landing page service covers conversion focused page work, while OpenAI's event documentation remains the source for the required payload fields.

Caveat: Event receipt does not prove attribution. OpenAI can receive a valid event without assigning it to an eligible ad interaction, especially when consent, browser storage, click references, event settings, or attribution windows do not line up.

How to test and troubleshoot events

Test one real journey from ad landing page to completed conversion before comparing Ads Manager with your CRM. OpenAI's Pixel testing instructions recommend using the selected Web Pixel's Test option in Ads Manager, opening a page where the Pixel is installed, completing the action, and reviewing the Event Stream.

Use this checklist:

  1. Check initialization. Confirm the browser console shows the expected Pixel ID and no script error.
  2. Check requests. Use the browser Network panel to confirm event requests leave the page.
  3. Check consent. Confirm the measurement request is allowed only after the consent state required for your users and jurisdiction.
  4. Check event names. Confirm the received event matches the event setting attached to the campaign.
  5. Check server delivery. Confirm the backend sends the event with the correct Pixel ID and CAPI key.
  6. Check deduplication. Compare the browser and server event IDs for the same action.
  7. Check recent events. Use the recent event stream to confirm the source and channel, then use conversion reporting for attributed results.

OpenAI's conversion troubleshooting guide warns that a tag manager's fired status alone does not prove delivery. Check the browser request, signed-in pages, checkout steps, redirects, embedded forms, and any page where the conversion can actually happen.

Do not treat a recent event as an immediate performance result. OpenAI separates event receipt from attribution, and reporting can take time to process. Compare records only after the same time range, account, campaign, event setting, and time zone are confirmed.

Common implementation mistakes

The most common failure is sending the browser and server events with different IDs. OpenAI cannot reliably deduplicate two reports that represent one action but use unrelated identifiers.

Another mistake is placing the CAPI key in frontend code. Browser users can inspect that code and requests, so server credentials must stay in backend secret storage. Rotate a key if it has been exposed.

A third mistake is measuring a button click instead of the business outcome. A user can click submit, fail validation, abandon payment, or close the page before the backend accepts the action. Send the final conversion from the system that confirms completion.

Consent and privacy also need a deliberate design. OpenAI's Conversion Measurement guidance says conversion data should be shared only when permitted and after users receive clear information about the data collected, with required consent obtained.

Finally, do not create several competing event settings for the same outcome without a clear reason. Start with one named conversion, verify the event path, and add more only when the campaign structure needs them. SocialStardom's ads management service can support the wider Google, Meta, and ChatGPT Ads workflow, while developers remain responsible for implementation accuracy.

FAQ

Can I use CAPI without installing the browser Pixel?

Yes. OpenAI's troubleshooting guidance says CAPI needs a Pixel ID even when you have not installed the browser Pixel. A server-only setup can send confirmed events, but a combined Pixel and CAPI setup can provide more measurement signals when both are implemented with the same event ID.

Does the Pixel replace the Conversions API?

No. The Pixel reports from the browser, while CAPI reports from your server. The Pixel can capture browser context and click information, while CAPI can send a confirmed backend outcome. Use both when your consent design, site architecture, and event flow support the combined setup.

What event should an ecommerce store send?

Use order_created when the purchase is completed and accepted by your system. OpenAI's supported event documentation defines standard events and their data shapes. Send the order value and currency in the format OpenAI requires, and reuse the order ID as the shared event ID.

Why do Ads Manager and Google Analytics show different conversions?

Different tools can use different attribution methods, attribution windows, time zones, consent signals, and deduplication rules. OpenAI's conversion measurement guidance says a difference does not automatically mean the Pixel or CAPI is broken. Compare definitions before changing the implementation.

Can a developer install the Pixel through Google Tag Manager?

Yes, if the tag manager loads the Pixel on the correct pages and does not block or reorder initialization and event calls. OpenAI's reporting guidance recommends checking the browser request itself, because a tag manager's firing message does not confirm that the event reached OpenAI.

How should a lead generation business define a conversion?

Define the event at the point where your backend or CRM accepts a valid enquiry. A form view or button click is an earlier action, not necessarily a lead. Use a stable lead ID, send the same ID through Pixel and CAPI when both report the action, and document the event owner.

How this was checked: This guide was checked against OpenAI's Measurement Pixel, Conversion Tracking, Conversions API, Conversion Measurement, Supported Events, Conversion Setup, and troubleshooting documentation. Updated December 6, 2026.

Found this useful? Share it with someone who runs a business.

SocialStardom Editorial Team

SocialStardom, a marketing and practical AI studio in Pune.

About SocialStardom

Free brand analysis

See what your customers see when they search for you.

Paste your website or Instagram handle. In about a minute you get a free analysis of how your business shows up online, and what to fix first.

Rather talk it through? Chat with Tara, our growth advisor. She replies in seconds.