Primary navigation

Conversions API

Server-to-server conversion events.

The Conversions API is a more reliable tracking source than the pixel alone. We encourage using the Conversions API when possible for more accurate insights.

Send events

Send events to the Conversions API from your server only.

curl -X POST "https://bzr.openai.com/v1/events?pid=<PIXEL-ID>" \
  -H "Authorization: Bearer <API-KEY>" \
  -H "Content-Type: application/json" \
  --data '{
    "validate_only": false,
    "events": []
  }'

You can provision a Pixel ID and Conversions API key from the conversions tab on your Ads Manager account.

ValueRequiredDescription
pidYesYour Pixel ID.
validate_onlyNoValidates events without saving them when true.
eventsYesThe events to send.

The API accepts batches of up to 1,000 events. If one event in the batch fails, the full batch fails.

Event structure

Each event includes the event metadata and a data object.

{
  "id": "order_12345",
  "type": "order_created",
  "timestamp_ms": 1773892800000,
  "oppref": "oppref_abc",
  "source_url": "https://shop.example.com/checkout/confirmation",
  "action_source": "web",
  "data": {
    "type": "contents"
  }
}
FieldRequiredDescription
idYesYour unique event identifier. Used with type to deduplicate events.
typeYesA supported standard event name, or custom.
timestamp_msYesEvent time in milliseconds. Must be within the last 7 days and no more than 10 minutes ahead.
custom_event_nameDependsRequired when type is custom.
opprefNoOpenAI-provided privacy-preserving identifier.
source_urlDependsRequired when action_source is web.
action_sourceNoOne of web, mobile_app, offline, physical_store, phone_call, email, or other.
userNoOptional user fields that can improve attribution accuracy for advertising conversions.
opt_outNoSet to true to opt out the event from future user-level personalization. Defaults to false.
dataYesEvent data matching the event type.

See Supported events for event names and data shapes.

Unlike the pixel, the API does not capture oppref for you. Capture the value yourself and pass it with the server event when it is available.

Example event

curl -X POST "https://bzr.openai.com/v1/events?pid=<PIXEL-ID>" \
  -H "Authorization: Bearer <API-KEY>" \
  -H "Content-Type: application/json" \
  --data '{
    "validate_only": false,
    "events": [
      {
        "id": "order_12345",
        "type": "order_created",
        "timestamp_ms": 1773892800000,
        "oppref": "oppref_abc",
        "source_url": "https://shop.example.com/checkout/confirmation",
        "action_source": "web",
        "data": {
          "type": "contents",
          "amount": 2599,
          "currency": "USD",
          "contents": [
            {
              "id": "sku_123",
              "name": "Starter bundle",
              "content_type": "product",
              "quantity": 1
            }
          ]
        }
      }
    ]
  }'

Deduplicate browser and server events

If you send the same conversion from the pixel and the Conversions API, reuse the same value as the API id and pixel event_id. Send both events with the same Pixel ID. For custom events, use the same custom_event_name on both sides as well.