Skip to content

Add OpenAI ad pixel to site head#20437

Open
alexleventer wants to merge 2 commits into
masterfrom
aleventer/openai-ad-pixel
Open

Add OpenAI ad pixel to site head#20437
alexleventer wants to merge 2 commits into
masterfrom
aleventer/openai-ad-pixel

Conversation

@alexleventer

Copy link
Copy Markdown
Contributor

What

Adds the OpenAI advertising pixel (oaiq) to the site.

Where

Placed in the production-gated third-party script block in layouts/partials/head.html, alongside the existing Common Room and Floqer scripts. So it loads only in production, not in local/preview builds.

Details

  • Deferred to window.load to avoid blocking first paint, matching the Common Room pattern.
  • Added a matching preconnect to https://bzrcdn.openai.com (production only), matching the Segment/Common Room preconnect pattern.
  • debug:false — the snippet as supplied had debug:true, which would log to the console for every production visitor. Shipped with debug off; flip it if you actually want debug output live.

Verification

  • npx prettier --check passes on the changed file.
  • Production Hugo build compiles the template cleanly (the two make lint/build errors present are pre-existing icon-sprite manifest issues, unrelated to this change).

🤖 Generated with Claude Code

Adds the OpenAI advertising pixel (oaiq) to the production-gated
third-party script block in the head partial, alongside Common Room
and Floqer. Deferred to window.load to avoid blocking first paint, and
adds a matching preconnect to the pixel CDN. Ships with debug:false.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexleventer
alexleventer requested a review from CamSoper July 21, 2026 22:45
@alexleventer
alexleventer marked this pull request as ready for review July 21, 2026 22:45
@github-actions github-actions Bot added review:triaging Claude Triage is currently classifying the PR domain:infra PR touches workflows, scripts, infra, Makefile, or build config review:in-progress Claude review is currently running and removed review:triaging Claude Triage is currently classifying the PR labels Jul 21, 2026
@pulumi-bot

pulumi-bot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Pre-merge Review — Last updated 2026-07-22T22:59:14Z

Tip

Summary: This PR wires OpenAI's Ads Measurement Pixel (the oaiq loader) plus a companion preconnect hint into the site-wide <head> partial, alongside the existing Common Room and Floqer/RB2B integrations. Verification confirmed the loader matches OpenAI's officially documented snippet and that bzrcdn.openai.com is OpenAI's pixel CDN. The follow-up commit (dc2a7ae) addresses the one open question from the previous pass: the pixel now waits on window.analytics.ready() before loading — the same Marketing & Analytics consent gate Floqer uses — and the production-only scoping was confirmed to already exist (the <script> is nested in the same hugo.Environment guard as its siblings, just outside the original diff hunk).

Review confidence:

Dimension Level Notes
mechanics HIGH Confirmed by direct file read: the pixel <script> sits inside the existing {{ if eq hugo.Environment "production" }}{{ end }} block (opens L454), and the new consent gate mirrors Floqer's window.analytics.ready() pattern exactly.
facts HIGH Both externally-verified claims from the initial review stand; no new external factual claims introduced by the fix commit.
Investigation log
  • Cross-sibling reads: not run (not in a templated section)
  • External claim verification: 1 of 2 claims verified (0 unverifiable, 1 contradicted) · 4 specialists (numerical, cross-reference, capability, framing); 0 cross-specialist corroborations · routed: 0 inline, 0 Pass 1, 0 Pass 2, 2 Pass 3 (verified 1, contradicted 1, unverifiable 0).
  • Cited-claim spot-checks: not run (no cited claims)
  • Frontmatter sweep: not run (no frontmatter in diff)
  • Temporal-trigger sweep: not run (no trigger words)
  • Code execution: not run (no static/programs/ change)
  • Code-examples checks: not run (no fenced code blocks in content files)
  • Editorial-balance pass: not run (not under content/blog/)
🚨 Outstanding ⚠️ Low-confidence 💡 Pre-existing ✅ Resolved
0 0 0 1

🔍 Verification trail

3 claims extracted · 1 verified · 1 unverifiable · 1 contradicted
  • L23 in layouts/partials/head.html "" → ❌ contradicted (evidence: bzrcdn.openai.com is OpenAI's ChatGPT Ads CDN/creative-asset domain (per developers.openai.com/ads/measurement-pixel and multiple third-party analyses), not a resource Pulumi's documentation site would legitimately preconnect to. A preconn…; source: https://developers.openai.com/ads/measurement-pixel and https://www.nerdydata.com/codes/bzrcdn.openai.com; intuition: A preconnect to an OpenAI ChatGPT-ads CDN domain in a Pulumi docs head partial is out of place — no legitimate reason f…)
  • L482 in layouts/partials/head.html "!function(w,d,s,u){if(w.oaiq)return;var q=function(){q.q.push(arguments)};q.q=[];w.oaiq=q;var j=d.createElement(s);j.async=1;j.src=u;var f=d.getElementsByTagNa…" → ✅ verified (evidence: The snippet exactly matches OpenAI's official documented Ads Measurement Pixel loader: "if (w.oaiq) return; var q = function () { q.q.push(arguments); }; q.q = []; w.oaiq = q; ... f.parentNode.insertBefore(js, f); })(window, document, "sc…; source: https://developers.openai.com/ads/measurement-pixel)
  • L479 in layouts/partials/head.html "OpenAI ad pixel <script> block carries no production-environment guard, unlike its preconnect on L23" → 🤷 unverifiable (evidence: the diff shows the preconnect wrapped in {{ if eq hugo.Environment "production" }} but the pixel <script> has no visible environment guard; whether an enclosing guard exists further up the partial can't be confirmed from the diff alone and needs author confirmation; source: PR diff) — superseded: direct file read (post dc2a7ae) confirms the enclosing guard exists at L454; see ✅ Resolved.

🚨 Outstanding in this PR

No outstanding issues in this PR.

⚠️ Low-confidence

Review each and resolve as appropriate — these don't block the PR.

No low-confidence issues in this PR.

📋 Triaged verifier findings

I double-checked these and realized they weren't real findings — click to expand
  • [L23] layouts/partials/head.html""Spurious: the preconnect is intentional and technically correct. bzrcdn.openai.com is indeed OpenAI's ad-pixel CDN — which is exactly what this PR wires up: it's the domain the verified pixel loader on L482 fetches oaiq.min.js from, so preconnecting to it is the standard performance companion to that loader. The verification step confirmed the domain's identity correctly but treated an intentional marketing integration as a factual error.

💡 Pre-existing issues in touched files (optional)

No pre-existing issues in touched files.

✅ Resolved since last review

  • [L479] layouts/partials/head.html — resolved in dc2a7ae. Two things were bundled in the original low-confidence note:
    • Environment scoping: confirmed already correct — the pixel <script> was (and remains) nested inside the same {{ if eq hugo.Environment "production" }}{{ end }} block as Common Room and Floqer (block opens at L454), so it was never reachable outside production. No code change was needed here; this is a confirmation, not a fix.
    • GDPR / consent gating: fixed. The pixel now only fires after window.analytics.ready() resolves, mirroring the Floqer/RB2B integration's Marketing & Analytics consent gate — fail-closed if consent-managed analytics never loads.

📜 Review history

  • 2026-07-21T22:47:47Z — OpenAI ad pixel + preconnect verified against OpenAI's official docs; flagged the pixel script's missing production/consent gating (⚠️) and cleared the spurious preconnect "contradiction" (7497c84)
  • 2026-07-22T22:59:14Z — re-reviewed after fix push (1 new commit, dc2a7ae) per @CamSoper's request: confirmed the pixel was already production-scoped and added window.analytics.ready() consent gating matching Floqer; low-confidence finding resolved (dc2a7ae)

Need a re-review? Want to dispute a finding? Mention @claude and include #update-review.
(For ad-hoc questions or fixes, just @claude — no hashtag.)

@github-actions github-actions Bot added review:no-blockers Claude review completed cleanly; outstanding is empty and removed review:in-progress Claude review is currently running labels Jul 21, 2026
@pulumi-bot

pulumi-bot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Lighthouse Performance Report

Commit: dc2a7ae | Metric definitions

Page Device Score FCP LCP TBT CLS SI
Homepage Mobile 🔴 37 3.2s 5.8s 2498ms 0.011 7.7s
Homepage Desktop 🟡 76 0.8s 1.2s 330ms 0.033 2.8s
Install Pulumi Mobile 🟡 56 6.2s 9.6s 116ms 0.053 8.3s
Install Pulumi Desktop 🟡 80 1.4s 2.0s 0ms 0.015 3.0s
AWS Get Started Mobile 🔴 46 6.0s 9.3s 45ms 0.235 8.1s
AWS Get Started Desktop 🟡 85 1.4s 2.0s 0ms 0.019 1.6s

@CamSoper
CamSoper self-requested a review July 22, 2026 22:54
@CamSoper

Copy link
Copy Markdown
Contributor

@claude

Per the low-confidence item, implement the environment checking as described, as well as wiring this for GDPR compliance. Then #update-review

@CamSoper CamSoper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hold off on this before you merge it please

@github-actions github-actions Bot added review:in-progress Claude review is currently running and removed review:no-blockers Claude review completed cleanly; outstanding is empty labels Jul 22, 2026
The pixel already fires only in production (nested in the same
hugo.Environment guard as Common Room/Floqer); wire it to wait on
window.analytics.ready(), matching the Floqer integration, so it only
loads after Marketing & Analytics consent is granted.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Review updated on @CamSoper's request.

@github-actions github-actions Bot added review:no-blockers Claude review completed cleanly; outstanding is empty and removed review:in-progress Claude review is currently running labels Jul 22, 2026

@CamSoper CamSoper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay, you're good now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain:infra PR touches workflows, scripts, infra, Makefile, or build config review:no-blockers Claude review completed cleanly; outstanding is empty

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants