Repository navigation
Conversation
V2 called window.optable.customAnalytics when the bidWinTimeout timer fired, so any field that depends on page state at auction time was read ~10s late. Call it in trackAuctionEnd for sampled auctions, keep the result on the stored auction, and merge it in toWitness on both the timer and visibilitychange paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
V2 prebid analytics calls
window.optable.customAnalyticswhen thebidWinTimeouttimer fires, ~10s afterauctionEnd. Fields that depend on page state at auction time are read stale. For example, a bundle that tags each auction with the frame it came from always reports the state left by whichever auction ran last.What Changed
prebid/analytics.ts: callcustomAnalyticsintrackAuctionEndfor sampled auctions, store the promise on the auction, and merge it intoWitnesson both the timer andvisibilitychangepaths. A baretoWitnesscall still invokescustomAnalyticsitself.prebid/analytics.test.ts: added a case where the value changes betweenauctionEndand send.prebid/analytics.md: documented whencustomAnalyticsis called.How to Test
pnpm test lib/addons/prebid/analytics.test.ts.mdalongside the code (for examplelib/addons/<addon>.md) and the matching README section. New addons ship with a new.md.Notes
customAnalyticsis no longer called for unsampled auctions.