Architecture brief

ChatGPT Ads for Shopify: build the conversion path that can be audited

The useful product is not another snippet injector. It is a traceable bridge from Shopify's customer events and orders to OpenAI's measurement endpoints, with consent, stable IDs, validation, retries, and reconciliation.

Recommended pattern: Shopify Web Pixel → app-controlled, CORS-enabled Cloudflare relay → OpenAI Conversions API. Add an order webhook as a purchase reconciliation path.

Why a direct browser snippet is fragile

Shopify App Pixels run in a strict web worker sandbox. They do not receive normal access to window or document. They can subscribe to Shopify customer events and use fetch, which makes an app-controlled, CORS-enabled relay the more dependable integration boundary.

A custom pixel has different constraints, but building the product around unrestricted page access creates a brittle promise. Treat browser measurement as one signal source and server delivery as the record you can monitor.

Event mapping for the first release

Shopify standard eventOpenAI eventWhat to preserve
page_viewedpage_viewedSource URL and attribution context
product_viewedcontents_viewedProduct identifiers and timestamp
product_added_to_cartitems_addedItems, quantities, and cart value
checkout_startedcheckout_startedCheckout ID and value in minor units
checkout_completedorder_createdStable order ID, currency, amount

The three records your dashboard should show

1. Captured

The event was received from Shopify with consent and required fields. This does not mean it was delivered.

2. Delivered

The relay submitted the event to OpenAI. Save the request timestamp, attempt count, response status, and a redacted validation result. Do not log access keys or unnecessary customer data.

3. Reconciled

The accepted purchase can be matched to the Shopify order using a stable event ID. A scheduled job can flag paid orders that have no accepted order_created record.

Important product limits

Launch checklist

  1. Run the public Pixel Helper on the final landing URL.
  2. Configure consent-aware Shopify event subscriptions.
  3. Send a test payload with OpenAI CAPI validation enabled.
  4. Place one test order and compare Shopify, relay, and OpenAI records.
  5. Rotate credentials after any exposure and add an event-gap alert.

Primary references: Shopify Web Pixels, OpenAI Conversions API, and OpenAI supported events.