← Back to Insights

How to Track Add-to-Cart, Checkout, and Purchase Events for OpenAI Ads

A practical guide to firing items_added, checkout_started, and order_created events for OpenAI Ads, with example code, required parameters, and the amount-formatting mistake that breaks most implementations.

2026-07-13 • Guide

Optimizing ad spend on OpenAI Ads requires conversion telemetry across your full store funnel, not just the final order receipt.

Mid-funnel interactions, such as viewing product details, adding items to the cart, and starting checkout, provide the critical event volume that ad bidding algorithms need during early learning phases before purchase volume ramps up.

Each step in the funnel requires specific standard event names and strict parameter formatting. Passing monetary amounts as floating decimals instead of minor-unit integers will cause OpenAI's ingestion endpoints to drop your data.

Here is how to implement contents_viewed, items_added, checkout_started, and order_created events across your storefront.

Supported eCommerce funnel events

The OpenAI Ads measurement pixel supports standard events aligned with common buying steps:

page_viewed: General page navigation, fired automatically on base pixel initialization.

contents_viewed: Product details view, triggered when a visitor views a specific catalog item.

items_added: Add to cart, fired when a visitor adds an item to their cart.

checkout_started: Checkout initiation, fired when a shopper begins the payment process.

order_created: Completed purchase, fired when the order successfully finalizes (your primary conversion metric).

Mobile app events (app_installed and app_opened) are supported exclusively via the server-side Conversions API and cannot be emitted by the browser pixel. If your store requires non-standard tracking (such as size-guide views or sample requests), use custom events with an explicit custom_event_name parameter.

Required payload schemas

Client-side event calls use the standard measurement syntax:

oaiq("measure", "event_name", eventData, options);

Parameter requirements

The event_name parameter specifies a standard event string (such as order_created).

The eventData object carries context fields. For eCommerce funnels, use the contents schema containing an amount, currency, and an array of contents objects.

The options object carries deduplication keys (event_id) and custom event identifiers (custom_event_name).

Key data fields

Monetary values (amount) must be formatted as integers in ISO 4217 minor currency units: cents for USD, pence for GBP. For instance, pass 12999 to represent $129.99 USD. Decimal strings or floats are invalid.

Currency codes (currency) are required whenever an amount is provided. Use three-letter uppercase ISO strings (USD, EUR, CAD).

Product arrays (contents) list individual line-item objects with id, quantity, and optional line item amounts.

Implementation code examples

1. Product details view (contents_viewed)

Execute when the primary product template renders:

oaiq("measure", "contents_viewed", {
  currency: "USD",
  contents: [
    { id: "SKU-1001", quantity: 1 }
  ]
});

2. Add to cart (items_added)

Execute inside your cart update callback after your server or cart state confirms the item was added:

oaiq("measure", "items_added", {
  currency: "USD",
  amount: 4999,
  contents: [
    { id: "SKU-1001", quantity: 1 }
  ]
});

3. Checkout initiation (checkout_started)

Execute when a shopper enters the checkout flow:

oaiq("measure", "checkout_started", {
  currency: "USD",
  amount: 8998,
  contents: [
    { id: "SKU-1001", quantity: 1 },
    { id: "SKU-2002", quantity: 1 }
  ]
});

4. Purchase confirmation (order_created)

Execute on the order confirmation template. Pass an event_id into options for server deduplication:

oaiq("measure", "order_created", {
  currency: "USD",
  amount: 8998,
  contents: [
    { id: "SKU-1001", quantity: 1 },
    { id: "SKU-2002", quantity: 1 }
  ]
}, {
  event_id: "order_48213"
});

5. Custom funnel interactions

For non-standard interactions, specify type: "custom" in data and provide custom_event_name in options:

oaiq("measure", "size_guide_viewed", {
  type: "custom"
}, {
  custom_event_name: "size_guide_viewed"
});

Currency and minor unit formatting

Formatting monetary values as decimals instead of minor units is a common error that skews revenue reporting:

Decimal input ($129.99 passed as 129.99) is invalid.

Minor unit integer input ($129.99 passed as 12999) is required.

Passing decimal numbers can result in values being interpreted incorrectly or rejected during ingestion. Verify that all monetary variables are multiplied by 100 and rounded to integers for two-decimal currencies prior to dispatch.

Funnel placement rules

Trigger event calls at the exact moment of confirmation:

Bind contents_viewed to the initial rendering of the product template instead of window scrolling events.

Bind items_added to confirmed AJAX or API responses. Firing on the submit button click logs attempts where inventory validation fails or payment methods decline.

Fire checkout_started once per unique checkout session instead of on individual form field interactions.

Guard order_created against page reloads. If a customer refreshes the thank-you screen or bookmarks the URL, ensure your template checks whether the order has already fired to avoid duplicate telemetry.

Pre-launch verification checklist

Validate each event prior to launching paid campaigns:

Enable debug: true in your oaiq("init", ...) configuration and monitor developer console outputs as you walk the funnel.

Inspect the Network tab to confirm that calls to bzr.openai.com return HTTP 202 status codes.

Use the OpenAI Ads Pixel Helper extension to verify detected event names on live pages.

Verify that the amount parameter reflects minor currency units across both whole dollar and cent amounts.

Confirm that events appear in OpenAI Ads Manager's real-time event log within a few minutes of testing.

Refresh the order confirmation URL to confirm that reload protections prevent duplicate purchase events.

For stores requiring complete attribution that survives ad blockers and mobile checkout exits, deploy matching server-side events using our Conversions API setup guide.

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.