OpenAI Ads Lead Generation Tracking: Pixel and CAPI Setup
How to wire up lead_created and registration_completed for OpenAI Ads, then close the loop with a CAPI event from your CRM once a lead is qualified, including the oppref capture step most setups miss.
Tracking lead generation conversions is fundamentally different from tracking eCommerce transactions. There is no shopping cart or product catalog, but form submissions bring their own unique set of tracking challenges.
Triggering a conversion event on a generic submit button click often trains ad algorithms on spam submissions, incomplete entries, and invalid email addresses. Multi-step funnels, Calendly widgets, and third-party tools like Typeform introduce redirect drops and iframe sandboxing that bypass client-side pixels completely.
Accurate lead generation tracking uses a two-stage approach: a client-side lead_created event to capture immediate intent and ad click cookies, paired with a server-side Conversions API (CAPI) dispatch from your CRM once a lead is actually qualified by your sales team.
Here is how to structure lead tracking on OpenAI Ads to eliminate junk attribution and optimize campaigns around verified pipeline revenue.
Standard lead generation events
OpenAI Ads defines two standard event names for lead funnels:
lead_created: The primary top-of-funnel conversion for contact inquiries, form submissions, and consultation requests.
registration_completed: Used when the visitor establishes a full user account or member portal profile.
OpenAI does not define a dedicated appointment_scheduled event name. If your funnel centers on booked demonstrations or sales calls, choose between two approaches:
Map demo bookings to lead_created if an appointment is your primary top-of-funnel goal.
Use a custom event with an explicit custom_event_name parameter (such as demo_scheduled or meeting_booked) if you need to distinguish bookings from general contact inquiries.
Custom events deduplicate cleanly across channels as long as the custom_event_name string matches character for character across both browser and server payloads.
1. Emitting client-side lead_created on submission
After initializing the pixel in your document head:
oaiq("init", { pixelId: "YOUR-PIXEL-ID" });
Attach your tracking trigger to confirmed submission responses instead of raw click events:
form.addEventListener("submit", function (event) {
event.preventDefault();
fetch("/api/leads", {
method: "POST",
body: new FormData(form)
}).then(function (response) {
if (response.ok) {
oaiq("measure", "lead_created", {
content_name: "demo-request-form"
});
}
});
});
Key implementation guidelines:
Bind tracking to confirmed server responses. Firing on the submit button's click handler records attempts where form validation fails or network connections drop.
Use content_name to distinguish different capture points across your domain, such as whitepaper downloads versus demo requests.
The client pixel automatically captures the source URL, event timestamp, and the oppref query parameter, storing the click token in a first-party __oppref cookie.
2. Dispatching qualified lead signals via server CAPI
A form submission registers initial user intent, but business value depends on whether the lead qualifies. In business-to-business funnels, qualification occurs days later inside a CRM (such as HubSpot or Salesforce) after sales discovery.
Server-side CAPI dispatches allow you to transmit qualification milestones directly from your CRM infrastructure without an active browser session:
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": "lead-48213-qualified",
"type": "lead_created",
"action_source": "system_generated",
"timestamp_ms": 1721000000000,
"data": {
"content_name": "demo-request-form",
"oppref": "OPPREF-VALUE-CAPTURED-AT-FORM-SUBMIT"
}
}]
}'
Critical parameters for CRM dispatches:
The oppref attribute: CAPI does not extract client-side cookies automatically. When a visitor submits your form, extract the __oppref cookie value via JavaScript and store it in a hidden form field or CRM contact property. When your CRM dispatches the qualified event later, forward this stored string to preserve campaign attribution.
The action_source property: Set this to system_generated or other for backend qualification events. If attaching deal sizes, pass integer minor units (such as 50000 for $500.00 USD) along with the ISO currency code.
Store your API bearer token exclusively within backend server environments. Review how to secure a CAPI implementation for key management protocols.
Distinguishing raw submissions from qualified pipeline
Optimizing solely for raw form submissions often leads algorithms to target visitors with high submission velocity but low qualification rates.
Transmitting both events gives ad optimization algorithms two distinct signals: top-of-funnel conversion volume and down-funnel lead quality. Bidding algorithms use these downstream signals to prioritize high-value prospects.
Handling multi-step forms and embedded schedulers
Multi-step forms and third-party tools require explicit tracking architecture:
Multi-step funnels: Fire lead_created only upon successful completion of the final submission step. If you want drop-off analytics between steps, emit distinct custom events such as form_step_2_completed instead of duplicating lead_created.
Third-party schedulers: Tools like Calendly and Typeform run in isolated iframes. Direct form submissions do not trigger your site's data layer. To track these conversions, configure the tool to redirect to a confirmation URL on your domain upon completion, or use backend webhooks to capture bookings server-side and dispatch CAPI events with forwarded click tokens.
End-to-end verification checklist
Verify each tracking component before allocating significant ad spend:
Confirm lead_created executes only after backend confirmation returns HTTP 200.
Confirm the __oppref cookie value persists into your database or CRM lead record.
Trigger a test qualification status in your CRM and verify the server CAPI call completes with timestamps within the allowable 7-day ingestion limit.
Verify that the forwarded oppref parameter is present in the server payload.
When using custom events for appointment booking, verify that custom_event_name matches character for character across both client and server calls.
Verify that multi-step forms trigger only once per completed lead submission.
Check that monetary deal values are formatted as minor-unit integers with accompanying currency codes.
A well-architected lead tracking system aligns your ad spend with actual sales pipeline instead of unverified form clicks.
Need ChatGPT tracking installed?
Configured, tested, documented.