How to Deduplicate OpenAI Ads Pixel and CAPI Events with Event IDs
If your OpenAI Ads pixel and Conversions API don't share the same event ID for each conversion, you double-count instead of recovering missed data, here's how matching actually works and how to test it before launch.
Most tracking bugs show up quickly because dashboards suddenly go empty or metrics drop to zero.
Deduplication failure does the exact opposite: it doubles your numbers.
When you run a browser pixel and a server Conversions API side by side without proper deduplication, every sale gets counted twice. A store doing $5,000 in real daily revenue suddenly reports $10,000 in OpenAI Ads Manager. Your return on ad spend looks incredible, encouraging you to pump budget into campaigns that are actually losing money hand over fist.
To run hybrid tracking safely, both the client pixel and the server CAPI call must send an identical event_id string for every unique conversion.
When OpenAI receives matching IDs within its attribution window, it fuses them into a single conversion event. When the IDs differ by even one character, it logs two distinct conversions.
Here is how to generate deterministic event IDs, pass them across client and server layers, and verify deduplication before scaling ad spend.
Warning signs of broken deduplication
Deduplication bugs rarely trigger error alerts. Look for these warning signs when checking your campaign numbers:
Conversions in Ads Manager consistently exceed orders in your real store ledger. If your ad dashboard claims 150 purchases while Stripe or Shopify only logged 100, broken deduplication is almost always the cause.
Reported ROAS spikes the exact day you deploy server-side tracking, without any increase in actual bank deposits.
Custom events show double counts while standard events look normal. This points to a mismatch in the custom_event_name parameter rather than an issue with the event ID.
How OpenAI reconciles twin events
OpenAI Ads checks for exact string matches across several fields before merging events:
First, matching Pixel IDs. The browser pixel's init call and the server CAPI request's pid query parameter must target the same pixel.
Second, matching event types. Both calls must specify the same standard event name, such as order_created.
Third, matching event identifiers. The pixel's event_id and the server's id property must contain identical strings.
Fourth, matching custom event names. For custom actions outside standard schemas, the custom_event_name string must match character for character on both payloads.
If any of these values differ, OpenAI assumes they represent separate customer actions and records duplicate sales.
Generating and passing deterministic event IDs
Generate the event identifier once from a business record that is inherently unique, such as an order number or checkout token. Never generate random UUIDs independently on the client and server.
1. Derive the identifier from existing order data
Build the string from the order record during checkout creation:
const eventId = `order-${order.id}`;
Reusing an existing database identifier guarantees that the client template and the backend webhook reference the exact same string without coordination overhead.
2. Pass the identifier to the browser pixel
Send the identifier inside the options argument of oaiq("measure", ...):
oaiq("measure", "order_created", {
currency: "USD",
value: 12999
}, {
event_id: `order-${order.id}`
});
Make sure your client script does not alter the formatting, casing, or prefix of the identifier.
3. Send the matching identifier via CAPI
In your server-side payload, pass the identical string into the id field:
curl -X POST "https://bzr.openai.com/v1/events?pid=PIXEL-ID" \
-H "Authorization: Bearer YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{
"data": [{
"id": "order-48213",
"type": "order_created",
"timestamp_ms": 1721000000000,
"action_source": "web",
"source_url": "https://example.com/checkout/confirmation",
"data": { "currency": "USD", "value": 12999 }
}]
}'
The source_url field is required whenever action_source is set to web. Timestamps must reflect epoch milliseconds within the last 7 days.
For custom events, verify the custom name across both sides:
// Browser pixel
oaiq("measure", "custom", {
custom_event_name: "demo_requested",
value: 0
}, {
event_id: `demo-${lead.id}`
});
# Server CAPI
curl -X POST "https://bzr.openai.com/v1/events?pid=PIXEL-ID" \
-H "Authorization: Bearer YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{
"data": [{
"id": "demo-9021",
"type": "custom",
"timestamp_ms": 1721000500000,
"action_source": "web",
"source_url": "https://example.com/demo-confirmed",
"data": { "custom_event_name": "demo_requested", "value": 0 }
}]
}'
Common deduplication slip-ups
Most double-counting issues come down to a few recurring snags:
Generating independent UUIDs on both ends. If your front-end script calls crypto.randomUUID() and your backend worker does the same, the two identifiers will never match. Always derive the ID from a shared order key.
Casing and prefix discrepancies. If the browser sends order_1001 and the server sends Order_1001, string comparison fails and you get duplicate conversions.
Missing custom event names. Custom events require matching both the identifier and the custom_event_name string.
Mismatched Pixel IDs. Sending browser events to one Pixel ID and CAPI dispatches to another isolates the two streams into separate silos that cannot be reconciled.
Stale server timestamps. Delayed worker queues that dispatch events older than 7 days fail ingestion entirely, preventing server deduplication from completing.
How to verify deduplication before scaling
Walk through these verification checks before sending live paid ad traffic:
Place a test order using a traceable identifier like test-order-001.
Inspect browser network logs in DevTools to confirm that bzr.openai.com receives the client hit with event_id.
Check your server execution logs to confirm your webhook dispatches the CAPI payload with the identical id.
Watch the real-time event stream in OpenAI Ads Manager. The test transaction should appear as a single consolidated conversion record rather than two separate events.
To speed up client-side checks before comparing server webhooks, open OpenAI Ads Pixel Helper in Chrome to inspect each fired oaiq() call and payload directly.
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.
Catching deduplication mismatches during testing protects your historical reporting from distortion. Our tracking audit reviews active event streams to confirm deduplication integrity and identify missing conversion signals across your funnel.
Need ChatGPT tracking installed?
Configured, tested, documented.