in src/lib/header-bidding/prebid/modules/analyticsAdapter.ts [24:55]
function getBidderCode(args: BidArgs): string {
if (args.bidderCode !== 'ozone') return args.bidderCode ?? '';
// Ozone represents several different advertisers
if (args.adserverTargeting) {
/**
* Each Ozone bid contains information about all the other bids.
* To pinpoint which advertiser is reponsible for the bid,
* we can match `adId` against the adserverTargeting key-values for each.
*
* For example, given `oz_appnexus_adId: "123abc456def789-0-0"`,
* we want to capture `appnexus` if `adId` matches `123abc456def789-0-0`
*/
for (const key in args.adserverTargeting) {
const [, advertiser, info] = key.split('_');
const value = args.adserverTargeting[key];
if (info === 'adId' && value === args.adId) {
return `ozone-${advertiser}`;
}
}
// If none matched, use ozone's winner as fallback
if (
args.adserverTargeting.oz_winner &&
typeof args.adserverTargeting.oz_winner === 'string'
) {
return `ozone-${args.adserverTargeting.oz_winner}`;
}
}
return `ozone-unknown`;
}