Skip to content

[SURF-1546] feat(conversions): fire the OpenAI Ads pixel - #71

Merged
paragmore merged 1 commit into
mainfrom
agent/ads-openai-pixel
Jul 27, 2026
Merged

[SURF-1546] feat(conversions): fire the OpenAI Ads pixel#71
paragmore merged 1 commit into
mainfrom
agent/ads-openai-pixel

Conversation

@paragmore

Copy link
Copy Markdown
Collaborator

Companion to surface_forms #5094. Fires the OpenAI Ads pixel from the parent embed tag (first-party context), mirroring the in-frame firing in surface_forms — the two paths stay in sync.

Changes

  • providers.ts: openai added to ConversionProvider; ensureOaiq bootstraps the oaiq SDK (bzrcdn.openai.com/sdk/oaiq.min.js) only if the global isn't already present, then oaiq("init", {pixelId}). Fire path calls oaiq("measure", event_name, {type:"customer_action"}, {event_id: response_id})event_id is the dedupe key.
  • conversion-listener.ts: openai added to VALID_PROVIDERS.

Payload shape reuses the Meta variant ({pixel_id, event_name}), so no wire-contract change.

🤖 Generated with Claude Code

https://claude.ai/code/session_018VUdEBjARoRAXvcVtaCS2N

@notion-workspace

Copy link
Copy Markdown

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown

Greptile Summary

Adds parent-context OpenAI Ads conversion tracking.

  • Adds OpenAI to the conversion provider type and message allowlist.
  • Loads and initializes the OpenAI Ads SDK before measuring customer actions with response IDs as deduplication keys.
  • Regenerates both distributed browser bundles with the OpenAI provider implementation and allowlist entry.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "[SURF-1546] feat(conversions): fire the ..." | Re-trigger Greptile

const CONVERSION_ACK_TYPE = "surface:conversion:ack";

const VALID_PROVIDERS: ConversionProvider[] = ["x", "meta", "ga4", "linkedin"];
const VALID_PROVIDERS: ConversionProvider[] = ["x", "meta", "openai", "ga4", "linkedin"];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Generated bundle rejects OpenAI

When the distributed embed receives an OpenAI conversion message, the unchanged surface_tag.js allowlist rejects it before dispatch, causing the new parent-context pixel path not to run. Regenerate and commit the browser bundle after this source change.

Context Used: CLAUDE.md (source)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, and already addressed. You reviewed 6bd10b2, which changed only the TypeScript source. The regenerated + committed bundle landed in the amended commit 04e8138 (surface_tag.js / surface_embed_v1.js now include ensureOaiq + the openai case + the openai entry in VALID_PROVIDERS). CI's "Bundle is up to date" check went from failing to passing on that commit, so deployed embeds will dispatch openai messages. Resolved.

Adds OpenAI Ads (oaiq) as a conversion provider in the parent embed tag,
mirroring the in-frame firing in surface_forms. Bootstraps the oaiq SDK if
absent, then measures a `customer_action` conversion with the response ID as
the event_id dedupe key.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VUdEBjARoRAXvcVtaCS2N
@paragmore
paragmore force-pushed the agent/ads-openai-pixel branch from 6bd10b2 to 04e8138 Compare July 27, 2026 09:40
@paragmore
paragmore merged commit 84faa92 into main Jul 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants