Skip to content

fix(analytics/ prototype): detect in-flight auctions as missed, remove bidWon#293

Merged
mosherBT merged 1 commit into
Optable:masterfrom
MO-Thibault:mo/analytics-missed-auction-fix
May 27, 2026
Merged

fix(analytics/ prototype): detect in-flight auctions as missed, remove bidWon#293
mosherBT merged 1 commit into
Optable:masterfrom
MO-Thibault:mo/analytics-missed-auction-fix

Conversation

@MO-Thibault
Copy link
Copy Markdown
Contributor

Summary

  • Fix missed auction detection: auctions that fired auctionInit before our analytics hook was set, but whose auctionEnd arrives after, are now correctly marked as missed=true. Previously only fully-completed past auctions (both auctionInit and auctionEnd in getEvents()) were caught.
  • Remove bidWon tracking: the trackBidWon method and all bidWon event listeners (replay + live) are removed — no longer needed.

How it works

  1. On init, replay past events in a single pass: collect auctionInit IDs into missedAuctionIds, then when an auctionEnd is encountered, remove from set and process as missed.
  2. Any IDs remaining in missedAuctionIds after replay are auctions that started but haven't ended yet (in-flight).
  3. Live auctionEnd listener checks missedAuctionIds — if the auction ID is present, it's an in-flight auction we missed, so it's marked missed=true and removed from the set.

Test plan

  • Deploy to a test page where the SDK loads after Prebid has already started auctions
  • Verify in-flight auctions (auctionInit fired, auctionEnd not yet fired at hook time) are marked missed=true in witness payload
  • Verify auctions that start after hook is set are marked missed=false
  • Verify no bid_won witness events are emitted

🤖 Generated with Claude Code

… bidWon tracking

Auctions that fired auctionInit before our hook was set but whose
auctionEnd arrives after are now correctly marked as missed. Previously
only fully-completed past auctions were caught. Also removes bidWon
event tracking which is no longer needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@MO-Thibault MO-Thibault changed the title fix(analytics/prebid): detect in-flight auctions as missed, remove bidWon fix(analytics/ prototype): detect in-flight auctions as missed, remove bidWon May 26, 2026
@mosherBT mosherBT merged commit 684cb4f into Optable:master May 27, 2026
7 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.

2 participants