Repository navigation
analytics: per-bidder EID delivery and troubleshooting fields in auction_processed - #351
Open
MO-Thibault wants to merge 2 commits into
Open
MO-Thibault wants to merge 2 commits into
MO-Thibault wants to merge 2 commits into
Conversation
…ion_processed Per-bidder delivery as a bitmask over the auction's optableSources, omitted when a bidder received every source. Adds slotSeq, t0, consent flags, cache age and idsMs, first-auction page config (RTD registration and both auctionDelay values), and Prebid Server bid matching with an unmatched count. Storage writes a <cacheKey>:ts sibling so cache age can be measured. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
|
Should we add this to V2 (prebid/analytics.ts) too ? |
Rename page.rtdOptable to page.optableRTDConfigured and add page.optableRTDInstalled (optableRtdProvider in pbjs.installedModules), so a module missing from the Prebid build can be told apart from one built in but not configured. Port the page object to the V2 add-on. V2 builds payloads after bidWinTimeout, so it sends page on the first payload via an instance flag rather than pageAuctionsCount === 1.
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.
Summary
Adds the fields we kept missing during enrichment and uplift investigations to the V1 analytics add-on (
lib/addons/prototypes/analytics.js), which feedsbid_analytics. Each one maps to a case that needed a browser harness or a partner conversation because the table could not answer it.Per-bidder EID delivery, with no payload growth in the normal case. Today each bidder request's
optableSourcesis computed and then collapsed into one auction-level union, so we cannot tell whether a given bidder received our IDs (ddm: whethermsftgot any after theappnexusrename). Each bidder request now carriesom, a bitmask over the auction-leveloptableSources(biti=optableSources[i]). It is omitted when the bidder received every source, which is the common case, so most payloads do not change. Absent means all sources;0means none.New fields
bidderRequests[].omoptableSourcesbidderRequests[].bids[].src"s2s"for Prebid Server responsesunmatchedBidsslotSeqt0consentcacheAgeidsMst0)page{ optableRTDInstalled, optableRTDConfigured, rtdDelay, udDelay }Documented in
lib/addons/prototypes/README.md.RTD presence in
pageoptableRTDInstalled(1/0):optableRtdProvideris inpbjs.installedModules, meaning it is compiled into the Prebid build.optableRTDConfigured(1/0):realTimeData.dataProviderscontains a provider namedoptable. Renamed fromrtdOptable.Together they separate "module missing from the build" from "built in but not configured". Paired with the per-bidder
omfield, they also separate "configured but delivered no EIDs".V2 add-on
The
pageobject is also ported to the V2 add-on (lib/addons/prebid/analytics.ts), with the same shape, in theoptable.prebid.auctionpayload. V2 builds payloads afterbidWinTimeout, when later auctions may already have bumpedpageAuctionsCount. So it sendspageon the first payload through an instance flag rather thanpageAuctionsCount === 1. When Prebid exposes nogetConfig,pageis omitted and retried on the next payload. Documented inlib/addons/prebid/analytics.md.Prebid Server responses
On ddm,
prebidServerrequests show about 6.7M per day with 0 priced bids recorded. The likely cause is that s2s bid responses carry arequestIdthat matches no clientbidId, sotrackAuctionEnddrops them. Received bids that do not match now fall back to the same bidder code and ad unit (first bid still waiting for a response), keepsrc: "s2s", and anything still unmatched is counted inunmatchedBids. Not yet verified on a live Prebid Server page;unmatchedBidswill tell us whether the fallback catches them.Core change
LocalStorage.setTargetingnow also writes<cacheKey>:tswith the write time, andclearTargetingremoves it. The cache value itself is unchanged, so wrappers that parseOPTABLE_RESOLVEDare unaffected. Control-group clearing that removesOPTABLE_RESOLVEDdirectly leaves the:tskey behind, which is harmless: analytics reports an age only when the cache itself is present.Not in this PR
bid_analyticsETL still needs columns for these fields (separate change in optable-solutions). Until then they are only in the raw payload.lib/addons/prebid/analytics.ts), onlypageis added. The other fields remain V1-only.Test plan
lib/addons/prototypes/analytics.test.js(16 tests):omomitted and masked,slotSeqcounting,t0, each consent bit, the three cache states and custom key, page config on the first auction only, RTD installed vs configured, s2s fallback match, unmatched count, client bids unchanged.lib/addons/prebid/analytics.test.ts(4 new tests): V2pageon the first payload only, RTD installed vs configured, and the missinginstalledModules/getConfigcases.lib/core/storage.test.js::tswritten onsetTargeting, removed onclearTargeting.pnpm build-libpasses.pnpm formatleaves no diff.auction_processedpayload.unmatchedBids.🤖 Generated with Claude Code