> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/integrations/chatgpt-ads/how-it-works.md).

# How it works: Shopify to OpenAI Ads

## What you can track

Here's what Littledata sends to OpenAI Ads. All events below are on by default. You can turn any of them off in the connection settings.

### Client-side events

| **Event name**  | **Description**                                          |
| --------------- | -------------------------------------------------------- |
| Page Viewed     | When a shopper views any page of your store              |
| Contents Viewed | When a shopper views a product page or a collection page |

Client-side events are sent by the OpenAI Measurement Pixel, which Littledata adds to your store. They include the product price and currency when Littledata can read them.

### Server-side events

| **Event name**   | **Description**                                                                                                                         |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Items Added      | When a shopper adds a product to the cart                                                                                               |
| Checkout Started | When a shopper starts checkout                                                                                                          |
| Order Created    | When a shopper places an order, including post-purchase upsells. Point of Sale orders and subscription renewals are left out by default |

Order Created is the only event that counts toward Order Created Sales and Order Created ROAS in Ads Manager.

Each event is sent from one side only. Cart, checkout and order events never come from the browser, so OpenAI Ads doesn't count them twice.

## Order value

Each Order Created event carries the order total, including tax and shipping, in the currency the shopper paid in. OpenAI Ads has no refund event, so refunds are not sent, and Ads Manager doesn't subtract them from sales.

## OpenAI click reference (oppref)

When a shopper clicks your ad in ChatGPT, OpenAI adds a click reference called `oppref` to your landing page URL. For up to 30 days after the click, Littledata sends it with that shopper's cart, checkout and order events, so a purchase on a later visit is still linked to the click.

## OpenAI browser reference (obref)

The OpenAI Measurement Pixel also saves a browser reference called `obref` in the shopper's browser. Littledata sends it with the server-side events for that shopper, which helps OpenAI Ads match them to the same person.

## Customer details for advanced matching

When available, Littledata sends these details with each event. Email, phone, first name, last name and customer ID are hashed with SHA-256 before they leave Littledata. City, region, postal code and country are sent as plain text, as OpenAI requires. The shopper's IP address and browser user agent are sent when they come from the shopper's own browser.

## Client-side (browser) tracking

Littledata adds the OpenAI Measurement Pixel to your store through the Littledata app embed in your theme. You don't need to add any code. The pixel sends page and product views and saves the `oppref` and `obref` references for the server-side events.

If your theme already has its own OpenAI Measurement Pixel code, Littledata doesn't add a second pixel. In that case Littledata doesn't send Page Viewed or Contents Viewed, but all server-side events are still sent.

## Server-side tracking

Littledata sends cart, checkout and order events to OpenAI Ads through the Conversions API, from Shopify order, cart and checkout data. Nothing needs to load in the shopper's browser for an order to be sent.

## Market parameters

OpenAI Ads events don't include the Shopify Market parameters (`market_handle` and `market_id`) that Littledata adds for other destinations. The Conversions API has no field for them.
