WayToClawEarn
High impactBuchodi Threat Intel / Hacker News

ChatGPT advertising attribution chain fully exposed: 4-layer Fernet encryption + contextual precise delivery, in-depth analysis of AI advertising technology architecture

安全研究员在 HN 上公开了 ChatGPT 广告系统完整技术架构:SSE 流实时注入广告、4 层 Fernet 加密 Token 构成归因链、OAIQ SDK 追踪用户点击行为。 This article analyzes the implications of this system for AI automated monetization from the perspective of an AI tool builder.

Apr 29, 2026 · 5 min read

Core conclusion

On April 28, 2026, security researcher Buchodi disclosed the complete technical implementation details of the ChatGPT advertising system on HN. This is not only a key step in the commercialization of OpenAI, but also the first public technical reference on how the AI ​​platform builds a native advertising attribution system.

Key findings:

  • Event time: 2026-04-28 Public disclosure (the actual system has been running for a period of time)
  • Affected objects: All AI tool builders, content creators, and affiliate practitioners who use ChatGPT
  • Core changes: ChatGPT injects advertisements into the conversation SSE flow and implements a complete click attribution closed loop through 4-layer Fernet encrypted tokens

Key Points

  • Ads are injected into the conversation stream in real time via the single_advertiser_ad_unit event of the SSE protocol
  • Each advertisement carries 4 Fernet encryption tokens, forming a complete attribution chain
  • Ad selection is based on contextual targeting, and the same account will receive different ads for different topics.
  • The tracking SDK is called OAIQ (v0.1.3) and enables cross-page 30-day attribution via the first-party cookie __oppref

Background: Technical anatomy of ChatGPT advertising system

Buchodi scraped both ends of the ChatGPT advertising system - the user side (ChatGPT) and the merchant side (SDK) - through a "consented mobile traffic research cluster". This is the first time the industry has gained such a complete end-to-end view.

This system has two halves: the ChatGPT side injects structured advertising objects into the SSE stream, and the merchant side reports product browsing behavior in the browser through the OAIQ SDK. The two are connected via Fernet encrypted click tokens.

Advertising injection mechanism on ChatGPT side

When a user sends a message to ChatGPT, the backend injects advertising events in addition to the model output in the SSE response stream of chatgpt.com/backend-api/f/conversation:

json
event: delta
data: {
  "type": "single_advertiser_ad_unit",
  "ads_request_id": "069e89b3-c038-7764-8000-6e5a193e5f69",
  "ads_spam_integrity_payload": "gAAAAABp6Js_<...redacted...>",
  "advertiser_brand": {
    "name": "Grubhub",
    "url": "www.grubhub.com",
    "favicon_url": "https://bzrcdn.openai.com/cabfae7ead26b03d.png",
    "id": "adacct_6984ed0ba55481a29894bb192f7773b4"
  },
  "carousel_cards": [{
    "title": "Get Chinese Food Delivered",
    "body": "Satisfy Your Cravings with Grubhub Delivery.",
    "image_url": "https://bzrcdn.openai.com/...",
    "target": { "type": "url", "value": "https://...", "open_externally": false }
  }]
}

关键设计细节:

  • single_advertiser_ad_unit 是类型化 Schema,命名暗示存在兄弟类型(multi-advertiser 等)
  • advertiser_brand.id 格式为 adacct_<32-hex>,是每个商户的稳定账号标识
  • 广告素材托管在 OpenAI 的 CDN(bzrcdn.openai.com),而非商户自己
  • target.open_externally: false 表示在 ChatGPT 内置 WebView 打开,OpenAI 可观测点击后导航

ChatGPT 广告 SSE 注入示意图

关键影响:4 层 Fernet 加密归因链

这是整个系统最精巧的部分。每条广告携带 4 个不同的 Fernet 加密数据块,构成完整的归因链路:

Token位置作用生命周期
ads_spam_integrity_payloadSSE 数据体内服务端防刷校验,防止伪造点击仅服务端
oppref点击 URL + OAIQ Cookie正向归因 Token,随每次像素事件传递Cookie TTL 720 小时(30 天)
olref点击 URL曝光侧日志记录,SDK 未存储仅跳转时
ad_data_tokenSSE payload 中 Base64 包裹的 JSON内含另一个 Fernet Token,点击时服务端对账SSE 内

Fernet 加密的前 9 字节是公开的(版本字节 0x80 + 8 字节大端 Unix 时间戳),因此无需 OpenAI 密钥即可恢复 Token 的生成时间:

python
import base64, struct, datetime
b = base64.urlsafe_b64decode("gAAAAABp7fdA" + "==")
print(datetime.datetime.utcfromtimestamp(struct.unpack(">Q", b[1:9])[0]))

# → 2026-04-26 11:30:08 UTC

Buchodi 实测发现:Home Depot 广告的点击 URL 的 Token 在 11:30:08 生成,浏览器在 11:31:43 获取商户页面。点击延迟仅 95 秒。

上下文定向的实际效果

同一账户在不同对话中收到完全不同的广告,证明 ChatGPT 的广告选择基于对话上下文

对话主题投放的广告
北京旅行(长城、故宫)Grubhub — "Get Chinese Food Delivered"
北京旅游预订GetYourGuide — 长城游, ad_id=beijing003
北京航班Axel — utm_term=vflight_beijing_03
NBA 季后赛Gametime — utm_campaign=nba&utm_content=playoffs
春季时尚趋势Aritzia — utm_campaign=chatgptpilot_trav3
效率工具/幻灯片Canva — utm_campaign=…link-clicks_products

适配建议:AI 工具构建者的启示

对 AI 内容创业者的机会

  1. 理解归因模型:ChatGPT 的 30 天 Cookie 归因窗口比大多数联盟平台更长,意味着从 ChatGPT 出发的推荐流量有更宽裕的转化窗口
  2. SEO+GEO 策略需要适应性调整:当用户通过 ChatGPT 搜索"推荐工具"时,系统可能直接注入广告而非展示你的内链内容——这意味着 GEO 优化不仅要考虑 AI 回答引擎的引用,还要考虑 AI 广告系统的竞价逻辑
  3. 监控 bzrcdn.openai.com 和 bzr.openai.com:这两个域名是投放广告的 CDN 和事件追踪域名,添加到监控或拦截列表可以理解广告系统的行为

对 AI Agent 开发者的技术提醒

  • SSE 流中的非模型事件:如果你的 Agent 通过 SSE 与 LLM 后端通信,需要处理非文本事件(ad units, tool calls 等)。不要假设 SSE 中所有 delta 都是模型输出
  • OAIQ SDK 模式可复制:通过首方 Cookie + 服务端计算点击延迟 + 端到端 Ferent 加密校验——这套归因架构值得 AI Agent 平台借鉴

任务清单

  • 检查自己的 AI 工具中是否正确处理了 SSE 流中的非模型事件
  • 评估 ChatGPT 广告对 Affiliate 流量来源的潜在影响
  • 关注 OpenAI 是否推出面向开发者的广告 SDK

参考来源

工具词条

正文中自然写出的工具品牌名包括:OpenAIChatGPTCanva. The platform side will automatically match tool_mentions of maintained tools.

Related reading

Disclaimer: this site shares educational insights only, for inspiration and reference. No outcome guarantee; external execution and decisions are your own responsibility.