What Gets Sent
Conversion Data (To OpenAI):- Purchases with revenue
- Subscription starts and trial starts
- Lead form submissions, signups, demo bookings
- Add to cart, checkout started, page viewed
- Any custom event you configure
How It Works
Conversion Flow
1. User Clicks OpenAI AdSetup
1. Connect OpenAI Ads Account
- Open OpenAI Ads Manager → Settings → Conversions
- Click + Create to add a Data Source (this is what DATALYR calls the Pixel ID). Copy the Data Source ID — it looks like
NKWGVw... - Click Manage conversion keys → + Create new key. The generated value is what DATALYR calls the API Key. Copy it.
- In DATALYR, go to Sources → Connect next to OpenAI Ads
- Paste the Conversion Key into the API Key field and the Data Source ID into the Pixel ID field
- Click Connect — DATALYR fires a
validate_only: truerequest to OpenAI to verify the credentials before saving. If anything’s wrong, the modal surfaces the error inline.
Don’t install OpenAI’s browser pixel script separately. OpenAI Ads Manager will offer you a<script>snippet that loadsoaiq.min.jsand fires events directly from the browser. With DATALYR’s Conversions API integration you don’t need it — DATALYR captures theopprefclick ID and fires every conversion server-side, including events from Stripe, Shopify, and other backend webhooks. Installing both would create duplicate events unless you carefully matchevent_idon every call.
2. Configure Conversion Events
- Go to Settings → Conversion Rules
- Map your DATALYR events to OpenAI event types:
purchase/order_completed→order_createdadd_to_cart→items_addedcheckout_started→checkout_startedlead→lead_createdcomplete_registration→registration_completedsubscribe→subscription_createdstart_trial→trial_started- Anything else →
custom(set thecustom_event_namein rule config)
- Set the value path (e.g.
properties.value) for events with revenue.
3. Test Your Setup
Toggle Test mode on a conversion rule. While enabled, every event we send to OpenAI includesvalidate_only: true — OpenAI validates the payload but does not record it for attribution. Use this to confirm the wire format without polluting your campaign signal. Disable test mode once you’re confident.
Supported Event Types
| OpenAI type | Data shape | Notes |
|---|---|---|
order_created | contents | Money in cents, currency required |
checkout_started | contents | |
items_added | contents | |
contents_viewed | contents | |
page_viewed | contents | |
lead_created | customer_action | |
registration_completed | customer_action | |
appointment_scheduled | customer_action | |
subscription_created | plan_enrollment | Set plan_id if available |
trial_started | plan_enrollment | |
custom | custom | Requires custom_event_name |
Deduplication With OpenAI’s Browser Pixel
If you also install OpenAI’soaiq.min.js browser pixel directly, OpenAI deduplicates browser-pixel events with our server-side CAPI events using the tuple (pixel_id, event_name, event_id). DATALYR sends the DATALYR event ID as the OpenAI event id. As long as your client-side pixel calls use the same event_id, you won’t double-count.
If you only use DATALYR (no OpenAI pixel on the page), there’s nothing to dedupe — every event is server-side.
Privacy & Consent
opprefis OpenAI’s privacy-preserving click identifier — it’s opaque, not cross-advertiser linkable, and rotates on OpenAI’s side. It’s the only attribution signal we send by default.- No PII is sent by default. OpenAI’s Conversions API documents
user{}as “optional user fields” with no schema or hashing rules, and their example payload doesn’t include user data. We mirror that design —opprefcarries the connection. - For users who opt out (via your consent banner), we send
opt_out: trueso OpenAI excludes the event from personalization while still counting it for aggregate measurement.
Optional: send hashed user data
If OpenAI publishes auser{} schema or you want to test with hashed PII as a match-rate fallback for cross-device conversions:
- Set
send_user_data: truein the conversion rule’sconfigobject, OR - Set the Cloudflare worker secret
OPENAI_SEND_USER_DATA=1(fleet-wide)
email, phone, first_name, last_name, city, state, postal_code, country, external_id plus raw ip and user_agent. Field names and hashing format are guesses based on industry convention until OpenAI documents the schema — verify with the canary script before flipping on for real customer traffic.
Troubleshooting
The connection fails to save with “Invalid API key” Re-generate the key in OpenAI Ads Manager → Conversions and paste the fresh value. Old keys revoke immediately on regeneration. Conversions don’t appear in OpenAI’s events feed Disable Test mode on your conversion rule —validate_only: true validates the payload but doesn’t record events for attribution. Then trigger a fresh conversion.
Events get rejected with a timestamp error
OpenAI rejects events older than 7 days or more than 10 minutes in the future. Server-side webhooks that arrive late (e.g. delayed Stripe/Shopify webhooks) will be silently dropped — that’s expected and won’t appear as a failure in your postback log.
Numbers don’t match OpenAI’s dashboard exactly
OpenAI’s reporting has its own attribution windows and modeling. Conversions sent via CAPI will appear, but the exact attribution credit depends on OpenAI’s last-click vs. modeled attribution settings.
Next Steps
Meta Ads
Send conversions to Facebook
Google Ads
Track Google Ads performance
TikTok Ads
Track TikTok ad performance
Conversion Rules
Configure conversion mapping
Customer Journeys
View attribution paths