Skip to content

analytics: V1 auction with Optable sources is not missed - #360

Closed
MO-Thibault wants to merge 1 commit into
Optable:masterfrom
MO-Thibault:mo/analytics-missed-v1
Closed

MO-Thibault wants to merge 1 commit into
Optable:masterfrom
MO-Thibault:mo/analytics-missed-v1

Conversation

@MO-Thibault

Copy link
Copy Markdown
Contributor

Summary

Same fix as #356, applied to the V1 add-on (lib/addons/prototypes/analytics.js), which is the one that sends auction_processed and feeds bid_analytics. #356 changes V2 only.

V1 flags an auction missed when it completed before the analytics hook attached, regardless of whether Optable EIDs were already on the bid requests. When the wrapper reads the EID cache before the hook attaches, the auction is enriched but still reported as missed. The payload now sends missed: missed && optableSources.length === 0, using the auction-level union already built for optableSources.

Case missed
Hooked in before the auction false
Hook attached late, Optable sources present false (was true)
Hook attached late, no sources true

V1 has no optableLoaded field, so unlike #356 there is no second field to keep tied to hook timing.

Downstream

Historical rows can be corrected in SQL with missed AND ARRAY_LENGTH(auction_struct.optableSources) = 0; the same expression is correct for rows emitted after this change.

Overlap

#351 adds lib/addons/prototypes/analytics.test.js. The tests here are in a separate file, analytics.missed.test.js, so the two PRs do not conflict on tests. The one-line change sits in witnessData, which #351 and #357 also edit; whichever merges later needs a trivial rebase.

Test plan

  • New lib/addons/prototypes/analytics.missed.test.js: the three cases above
  • The "late, sources present" test fails against the old line
  • pnpm exec jest: 30 suites, 526 tests pass
  • prettier --check clean on both files

🤖 Generated with Claude Code

Same fix as Optable#356, applied to the V1 add-on that feeds bid_analytics.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@MO-Thibault
MO-Thibault requested review from a team as code owners October 5, 2026 15:49
@MO-Thibault

Copy link
Copy Markdown
Contributor Author

Folded into #356 instead.

@MO-Thibault MO-Thibault closed this Oct 5, 2026
@MO-Thibault
MO-Thibault deleted the mo/analytics-missed-v1 branch October 5, 2026 15:54
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.

1 participant