From ccab78d09294bc4d58d26751b53931e2d20ea233 Mon Sep 17 00:00:00 2001 From: aslagle Date: Tue, 21 Mar 2023 14:25:15 -0600 Subject: [PATCH 1/8] Return all bids --- modules/magniteAnalyticsAdapter.js | 94 +++++++++++++++++++++++++++--- 1 file changed, 85 insertions(+), 9 deletions(-) diff --git a/modules/magniteAnalyticsAdapter.js b/modules/magniteAnalyticsAdapter.js index 9d437c0b246..2efacd11ac6 100644 --- a/modules/magniteAnalyticsAdapter.js +++ b/modules/magniteAnalyticsAdapter.js @@ -37,7 +37,8 @@ const { BIDDER_DONE, BID_TIMEOUT, BID_WON, - BILLABLE_EVENT + BILLABLE_EVENT, + SEAT_NON_BID }, STATUS: { GOOD, @@ -437,12 +438,20 @@ const sizeToDimensions = size => { }; } -const findMatchingAdUnitFromAuctions = (matchesFunction, returnFirstMatch) => { +const findMatchingAdUnitFromOrderedAuctions = (matchesFunction, returnFirstMatch) => { + return findAdUnitFromAuctions(matchesFunction, returnFirstMatch, cache.auctionOrder); +}; + +const findMatchingAdUnitFromAllAuctions = (matchesFunction, returnFirstMatch) => { + return findAdUnitFromAuctions(matchesFunction, returnFirstMatch, cache.auctions); +}; + +const findAdUnitFromAuctions = (matchesFunction, returnFirstMatch, auctions) => { // finding matching adUnit / auction let matches = {}; // loop through auctions in order and adunits - for (const auctionId of cache.auctionOrder) { + for (const auctionId of auctions) { const auction = cache.auctions[auctionId].auction; for (const transactionId in auction.adUnits) { const adUnit = auction.adUnits[transactionId]; @@ -464,7 +473,7 @@ const findMatchingAdUnitFromAuctions = (matchesFunction, returnFirstMatch) => { } } return matches; -} +}; const getRenderingIds = bidWonData => { // if bid caching off -> return the bidWon auction id @@ -481,7 +490,7 @@ const getRenderingIds = bidWonData => { const gamHasRendered = deepAccess(cache, `auctions.${auction.auctionId}.gamRenders.${adUnit.transactionId}`); return adUnit.adUnitCode === bidWonData.adUnitCode && gamHasRendered; } - let { adUnit, auction } = findMatchingAdUnitFromAuctions(matchingFunction, false); + let { adUnit, auction } = findMatchingAdUnitFromOrderedAuctions(matchingFunction, false); // If no match was found, we will use the actual bid won auction id return { renderTransactionId: (adUnit && adUnit.transactionId) || bidWonData.transactionId, @@ -554,7 +563,7 @@ const subscribeToGamSlots = () => { const gamHasRendered = deepAccess(cache, `auctions.${auction.auctionId}.gamRenders.${adUnit.transactionId}`); return matchesSlot && !gamHasRendered; } - let { adUnit, auction } = findMatchingAdUnitFromAuctions(matchingFunction, true); + let { adUnit, auction } = findMatchingAdUnitFromOrderedAuctions(matchingFunction, true); const slotName = `${event.slot.getAdUnitPath()} - ${event.slot.getSlotElementId()}`; @@ -821,10 +830,14 @@ magniteAdapter.track = ({ eventType, args }) => { auctionEntry.floors.dealsEnforced = args.floorData.enforcements.floorDeals; } - // Log error if no matching bid! + // no-bid from server. Document it! if (!bid) { - logError(`${MODULE_NAME}: Could not find associated bid request for bid response with requestId: `, args.requestId); - break; + bid = adUnit.bids[generateUUID()] = { + bidder: 'mgnipbs', + source: 'server', + status: 'no-bid', + bidId: args.requestId + }; } // set bid status @@ -852,6 +865,9 @@ magniteAdapter.track = ({ eventType, args }) => { bid.pbsBidId = pbsBidId; } break; + case SEAT_NON_BID: + handleNonBidEvent(args); + break; case BIDDER_DONE: const serverError = deepAccess(args, 'serverErrors.0'); const serverResponseTimeMs = args.serverResponseTimeMs; @@ -939,6 +955,66 @@ magniteAdapter.track = ({ eventType, args }) => { } }; +const handleNonBidEvent = function(args) { + let {seatnonbid, auctionId} = args; + seatnonbid.forEach(seatnonbid => { + let {seat} = seatnonbid; + seatnonbid.nonbid.forEach(nonbid => { + let {status, impid} = nonbid; + let matchByImpid = matchAuctionBeforeAdUnit(auctionId, impid) + let {adUnit} = findMatchingAdUnitFromAllAuctions(matchByImpid, true); + try { + let statusInfo = statusMap[status] || { status: 'no-bid' } + adUnit.bids[generateUUID()] = { + source: 'server', + bidder: seat, + isSeatNonBid: true, + clientLatencyMillis: Date.now() - cache.auctions[args.auctionId].auction.auctionStart, + ...statusInfo + }; + } catch (error) { + logWarn(`Unable to match nonbid to adUnit`); + } + }); + }); +}; + +const matchAuctionBeforeAdUnit = function(auctionId, impid) { + return function (adUnit, auction) { + if (auctionId !== auction.auctionId) return false; + return adUnit.code === impid; + } +}; + +const statusMap = { + 0: { + status: 'no-bid' + }, + 100: { + status: 'error', + error: { + code: 'request-error', + description: 'general error' + } + }, + 101: { + status: 'error', + error: { + code: 'timeout-error', + description: 'prebid server timeout' + } + }, + 200: { + status: 'rejected' + }, + 202: { + status: 'rejected' + }, + 301: { + status: 'rejected-ipf' + } +}; + adapterManager.registerAnalyticsAdapter({ adapter: magniteAdapter, code: 'magnite', From 481847dfd66109b75caa3a28ff717006d41bd02a Mon Sep 17 00:00:00 2001 From: aslagle Date: Tue, 21 Mar 2023 15:25:56 -0600 Subject: [PATCH 2/8] Adjust findMatch function --- modules/magniteAnalyticsAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/magniteAnalyticsAdapter.js b/modules/magniteAnalyticsAdapter.js index 2efacd11ac6..333b437ffb7 100644 --- a/modules/magniteAnalyticsAdapter.js +++ b/modules/magniteAnalyticsAdapter.js @@ -443,7 +443,7 @@ const findMatchingAdUnitFromOrderedAuctions = (matchesFunction, returnFirstMatch }; const findMatchingAdUnitFromAllAuctions = (matchesFunction, returnFirstMatch) => { - return findAdUnitFromAuctions(matchesFunction, returnFirstMatch, cache.auctions); + return findAdUnitFromAuctions(matchesFunction, returnFirstMatch, Object.keys(cache.auctions)); }; const findAdUnitFromAuctions = (matchesFunction, returnFirstMatch, auctions) => { @@ -982,7 +982,7 @@ const handleNonBidEvent = function(args) { const matchAuctionBeforeAdUnit = function(auctionId, impid) { return function (adUnit, auction) { if (auctionId !== auction.auctionId) return false; - return adUnit.code === impid; + return adUnit.adUnitCode === impid; } }; From a667e40a19ba947400b2d6859ad5ef9ce2dadc97 Mon Sep 17 00:00:00 2001 From: aslagle Date: Tue, 28 Mar 2023 11:59:44 -0600 Subject: [PATCH 3/8] Return all buds unit testing --- modules/magniteAnalyticsAdapter.js | 4 +- .../modules/magniteAnalyticsAdapter_spec.js | 127 +++++++++++++++++- 2 files changed, 129 insertions(+), 2 deletions(-) diff --git a/modules/magniteAnalyticsAdapter.js b/modules/magniteAnalyticsAdapter.js index 333b437ffb7..1f5c18c37a5 100644 --- a/modules/magniteAnalyticsAdapter.js +++ b/modules/magniteAnalyticsAdapter.js @@ -836,8 +836,10 @@ magniteAdapter.track = ({ eventType, args }) => { bidder: 'mgnipbs', source: 'server', status: 'no-bid', - bidId: args.requestId + bidId: args.requestId, + clientLatencyMillis: args.timeToRespond || Date.now() - cache.auctions[args.auctionId].auction.auctionStart }; + return; } // set bid status diff --git a/test/spec/modules/magniteAnalyticsAdapter_spec.js b/test/spec/modules/magniteAnalyticsAdapter_spec.js index b27e8f30881..d678fa244e1 100644 --- a/test/spec/modules/magniteAnalyticsAdapter_spec.js +++ b/test/spec/modules/magniteAnalyticsAdapter_spec.js @@ -28,7 +28,8 @@ const { BIDDER_DONE, BID_WON, BID_TIMEOUT, - BILLABLE_EVENT + BILLABLE_EVENT, + SEAT_NON_BID } } = CONSTANTS; @@ -160,6 +161,23 @@ const MOCK = { 'status': 'rendered', getStatusCode: () => 1, }, + NO_BID: { + 'requestId': 'fakeId', + 'transactionId': '7b10a106-89ea-4e19-bc51-9b2e970fc42a', + 'auctionId': '99785e47-a7c8-4c8a-ae05-ef1c717a4b4d', + 'adUnitCode': 'box', + getStatusCode: () => 1, + }, + SEAT_NON_BID: { + auctionId: '99785e47-a7c8-4c8a-ae05-ef1c717a4b4d', + seatnonbid: [{ + seat: 'rubicon', + nonbid: [{ + status: 1, + impid: 'box' + }] + }] + }, AUCTION_END: { 'auctionId': '99785e47-a7c8-4c8a-ae05-ef1c717a4b4d', 'auctionEnd': 1658868384019, @@ -2039,4 +2057,111 @@ describe('magnite analytics adapter', function () { } }) }); + + describe('BID_RESPONSE events', () => { + beforeEach(() => { + magniteAdapter.enableAnalytics({ + options: { + endpoint: '//localhost:9999/event', + accountId: 1001 + } + }); + config.setConfig({ rubicon: { updatePageView: true } }); + }); + + it('should add a no-bid bid to the add unit if it recieves one from the server', () => { + const bidResponse = utils.deepClone(MOCK.NO_BID); + const auctionInit = utils.deepClone(MOCK.AUCTION_INIT); + + delete auctionInit.adUnits[0].sizes; + + bidResponse.requestId = 'fakeId'; + events.emit(AUCTION_INIT, auctionInit); + events.emit(BID_REQUESTED, MOCK.BID_REQUESTED); + events.emit(BID_RESPONSE, bidResponse) + events.emit(BIDDER_DONE, MOCK.BIDDER_DONE); + events.emit(AUCTION_END, MOCK.AUCTION_END); + clock.tick(rubiConf.analyticsBatchTimeout + 1000); + + let message = JSON.parse(server.requests[0].requestBody); + expect(utils.generateUUID.called).to.equal(true); + + expect(message.auctions[0].adUnits[0].bids[1]).to.deep.equal( + { + bidder: 'mgnipbs', + source: 'server', + status: 'no-bid', + bidId: 'fakeId', + clientLatencyMillis: -139101369960 + } + ); + }); + }); + + describe('SEAT_NON_BID events', () => { + let seatnonbid; + + const runNonBidAuction = () => { + events.emit(AUCTION_INIT, MOCK.AUCTION_INIT); + events.emit(BID_REQUESTED, MOCK.BID_REQUESTED); + events.emit(SEAT_NON_BID, seatnonbid) + events.emit(BIDDER_DONE, MOCK.BIDDER_DONE); + events.emit(AUCTION_END, MOCK.AUCTION_END); + clock.tick(rubiConf.analyticsBatchTimeout + 1000); + }; + const checkStatusAgainstCode = (status, code, error, index) => { + seatnonbid.seatnonbid[0].nonbid[0].status = code; + runNonBidAuction(); + let message = JSON.parse(server.requests[index].requestBody); + let bid = message.auctions[0].adUnits[0].bids[1]; + + if (error) { + expect(bid.error).to.deep.equal(error); + } else { + expect(bid.error).to.equal(undefined); + } + expect(bid.source).to.equal('server'); + expect(bid.status).to.equal(status); + expect(bid.isSeatNonBid).to.equal(true); + }; + beforeEach(() => { + magniteAdapter.enableAnalytics({ + options: { + endpoint: '//localhost:9999/event', + accountId: 1001 + } + }); + config.setConfig({ rubicon: { updatePageView: true } }); + seatnonbid = utils.deepClone(MOCK.SEAT_NON_BID); + }); + + it('adds seatnonbid info to bids array', () => { + runNonBidAuction(); + let message = JSON.parse(server.requests[0].requestBody); + + expect(message.auctions[0].adUnits[0].bids[1]).to.deep.equal( + { + bidder: 'rubicon', + source: 'server', + status: 'no-bid', + isSeatNonBid: true, + clientLatencyMillis: -139101369960 + } + ); + }); + + it('adjusts the status according to the status map', () => { + const statuses = [ + {code: 0, status: 'no-bid'}, + {code: 100, status: 'error', error: {code: 'request-error', description: 'general error'}}, + {code: 101, status: 'error', error: {code: 'timeout-error', description: 'prebid server timeout'}}, + {code: 200, status: 'rejected'}, + {code: 202, status: 'rejected'}, + {code: 301, status: 'rejected-ipf'} + ]; + statuses.forEach((info, index) => { + checkStatusAgainstCode(info.status, info.code, info.error, index); + }); + }); + }); }); From d4a2145325dedad48c546de67361d08920d5b67c Mon Sep 17 00:00:00 2001 From: aslagle Date: Fri, 31 Mar 2023 11:59:20 -0600 Subject: [PATCH 4/8] Responds to review comments --- modules/magniteAnalyticsAdapter.js | 54 ++++++++----------- .../modules/magniteAnalyticsAdapter_spec.js | 10 +++- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/modules/magniteAnalyticsAdapter.js b/modules/magniteAnalyticsAdapter.js index 1f5c18c37a5..18076bb00fa 100644 --- a/modules/magniteAnalyticsAdapter.js +++ b/modules/magniteAnalyticsAdapter.js @@ -438,20 +438,12 @@ const sizeToDimensions = size => { }; } -const findMatchingAdUnitFromOrderedAuctions = (matchesFunction, returnFirstMatch) => { - return findAdUnitFromAuctions(matchesFunction, returnFirstMatch, cache.auctionOrder); -}; - -const findMatchingAdUnitFromAllAuctions = (matchesFunction, returnFirstMatch) => { - return findAdUnitFromAuctions(matchesFunction, returnFirstMatch, Object.keys(cache.auctions)); -}; - -const findAdUnitFromAuctions = (matchesFunction, returnFirstMatch, auctions) => { +const findMatchingAdUnitFromAuctions = (matchesFunction, returnFirstMatch) => { // finding matching adUnit / auction let matches = {}; // loop through auctions in order and adunits - for (const auctionId of auctions) { + for (const auctionId of cache.auctionOrder) { const auction = cache.auctions[auctionId].auction; for (const transactionId in auction.adUnits) { const adUnit = auction.adUnits[transactionId]; @@ -490,7 +482,7 @@ const getRenderingIds = bidWonData => { const gamHasRendered = deepAccess(cache, `auctions.${auction.auctionId}.gamRenders.${adUnit.transactionId}`); return adUnit.adUnitCode === bidWonData.adUnitCode && gamHasRendered; } - let { adUnit, auction } = findMatchingAdUnitFromOrderedAuctions(matchingFunction, false); + let { adUnit, auction } = findMatchingAdUnitFromAuctions(matchingFunction, false); // If no match was found, we will use the actual bid won auction id return { renderTransactionId: (adUnit && adUnit.transactionId) || bidWonData.transactionId, @@ -563,7 +555,7 @@ const subscribeToGamSlots = () => { const gamHasRendered = deepAccess(cache, `auctions.${auction.auctionId}.gamRenders.${adUnit.transactionId}`); return matchesSlot && !gamHasRendered; } - let { adUnit, auction } = findMatchingAdUnitFromOrderedAuctions(matchingFunction, true); + let { adUnit, auction } = findMatchingAdUnitFromAuctions(matchingFunction, true); const slotName = `${event.slot.getAdUnitPath()} - ${event.slot.getSlotElementId()}`; @@ -830,16 +822,19 @@ magniteAdapter.track = ({ eventType, args }) => { auctionEntry.floors.dealsEnforced = args.floorData.enforcements.floorDeals; } - // no-bid from server. Document it! - if (!bid) { - bid = adUnit.bids[generateUUID()] = { - bidder: 'mgnipbs', + // no-bid from server. report it! + if (!bid && args.seatBidId) { + bid = adUnit.bids[args.seatBidId] = { + bidder: args.bidderCode, source: 'server', - status: 'no-bid', - bidId: args.requestId, - clientLatencyMillis: args.timeToRespond || Date.now() - cache.auctions[args.auctionId].auction.auctionStart + bidId: args.seatBidId, + unknownBid: true }; - return; + } + + if (!bid) { + logError(`${MODULE_NAME}: Could not find associated bid request for bid response with requestId: `, args.requestId); + break; } // set bid status @@ -958,15 +953,17 @@ magniteAdapter.track = ({ eventType, args }) => { }; const handleNonBidEvent = function(args) { - let {seatnonbid, auctionId} = args; + const {seatnonbid, auctionId} = args; + const auction = deepAccess(cache, `auctions.${auctionId}.auction`); + const adUnits = auction.adUnits; seatnonbid.forEach(seatnonbid => { let {seat} = seatnonbid; seatnonbid.nonbid.forEach(nonbid => { - let {status, impid} = nonbid; - let matchByImpid = matchAuctionBeforeAdUnit(auctionId, impid) - let {adUnit} = findMatchingAdUnitFromAllAuctions(matchByImpid, true); try { - let statusInfo = statusMap[status] || { status: 'no-bid' } + const {status, impid} = nonbid; + const matchingTid = Object.keys(adUnits).find(tid => adUnits[tid].adUnitCode === impid); + const adUnit = adUnits[matchingTid]; + const statusInfo = statusMap[status] || { status: 'no-bid' }; adUnit.bids[generateUUID()] = { source: 'server', bidder: seat, @@ -981,13 +978,6 @@ const handleNonBidEvent = function(args) { }); }; -const matchAuctionBeforeAdUnit = function(auctionId, impid) { - return function (adUnit, auction) { - if (auctionId !== auction.auctionId) return false; - return adUnit.adUnitCode === impid; - } -}; - const statusMap = { 0: { status: 'no-bid' diff --git a/test/spec/modules/magniteAnalyticsAdapter_spec.js b/test/spec/modules/magniteAnalyticsAdapter_spec.js index d678fa244e1..ffa8ae19382 100644 --- a/test/spec/modules/magniteAnalyticsAdapter_spec.js +++ b/test/spec/modules/magniteAnalyticsAdapter_spec.js @@ -163,10 +163,12 @@ const MOCK = { }, NO_BID: { 'requestId': 'fakeId', + 'seatBidId': 'fakeId', + 'bidderCode': 'mgnipbs', 'transactionId': '7b10a106-89ea-4e19-bc51-9b2e970fc42a', 'auctionId': '99785e47-a7c8-4c8a-ae05-ef1c717a4b4d', 'adUnitCode': 'box', - getStatusCode: () => 1, + getStatusCode: () => 2, }, SEAT_NON_BID: { auctionId: '99785e47-a7c8-4c8a-ae05-ef1c717a4b4d', @@ -2091,6 +2093,12 @@ describe('magnite analytics adapter', function () { bidder: 'mgnipbs', source: 'server', status: 'no-bid', + bidResponse: { + "bidPriceUSD": 0, + "conversionError": true + }, + oldBidId: 'fakeId', + unknownBid: true, bidId: 'fakeId', clientLatencyMillis: -139101369960 } From c90c7d17962fe043db31f6e3343b5b89c4af70b0 Mon Sep 17 00:00:00 2001 From: aslagle Date: Fri, 31 Mar 2023 14:21:17 -0600 Subject: [PATCH 5/8] Unit test adjustments --- .../modules/magniteAnalyticsAdapter_spec.js | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/test/spec/modules/magniteAnalyticsAdapter_spec.js b/test/spec/modules/magniteAnalyticsAdapter_spec.js index ffa8ae19382..fc05999f226 100644 --- a/test/spec/modules/magniteAnalyticsAdapter_spec.js +++ b/test/spec/modules/magniteAnalyticsAdapter_spec.js @@ -161,15 +161,6 @@ const MOCK = { 'status': 'rendered', getStatusCode: () => 1, }, - NO_BID: { - 'requestId': 'fakeId', - 'seatBidId': 'fakeId', - 'bidderCode': 'mgnipbs', - 'transactionId': '7b10a106-89ea-4e19-bc51-9b2e970fc42a', - 'auctionId': '99785e47-a7c8-4c8a-ae05-ef1c717a4b4d', - 'adUnitCode': 'box', - getStatusCode: () => 2, - }, SEAT_NON_BID: { auctionId: '99785e47-a7c8-4c8a-ae05-ef1c717a4b4d', seatnonbid: [{ @@ -2072,10 +2063,12 @@ describe('magnite analytics adapter', function () { }); it('should add a no-bid bid to the add unit if it recieves one from the server', () => { - const bidResponse = utils.deepClone(MOCK.NO_BID); + const bidResponse = utils.deepClone(MOCK.BID_RESPONSE); const auctionInit = utils.deepClone(MOCK.AUCTION_INIT); - delete auctionInit.adUnits[0].sizes; + bidResponse.requestId = 'fakeId'; + bidResponse.seatBidId = 'fakeId'; + bidResponse.requestId = 'fakeId'; events.emit(AUCTION_INIT, auctionInit); @@ -2090,17 +2083,21 @@ describe('magnite analytics adapter', function () { expect(message.auctions[0].adUnits[0].bids[1]).to.deep.equal( { - bidder: 'mgnipbs', + bidder: 'rubicon', source: 'server', - status: 'no-bid', + status: 'success', bidResponse: { - "bidPriceUSD": 0, - "conversionError": true + 'bidPriceUSD': 3.4, + 'dimensions': { + 'height': 250, + 'width': 300 + }, + 'mediaType': 'banner' }, oldBidId: 'fakeId', unknownBid: true, bidId: 'fakeId', - clientLatencyMillis: -139101369960 + clientLatencyMillis: 271 } ); }); @@ -2139,7 +2136,6 @@ describe('magnite analytics adapter', function () { accountId: 1001 } }); - config.setConfig({ rubicon: { updatePageView: true } }); seatnonbid = utils.deepClone(MOCK.SEAT_NON_BID); }); From d5e116f01699775f452f360cf0296052cf6f941e Mon Sep 17 00:00:00 2001 From: Robert Ray Martinez III Date: Mon, 3 Apr 2023 09:30:45 -0700 Subject: [PATCH 6/8] Remove extra line for lint --- test/spec/modules/magniteAnalyticsAdapter_spec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/spec/modules/magniteAnalyticsAdapter_spec.js b/test/spec/modules/magniteAnalyticsAdapter_spec.js index fc05999f226..bf9c3050bf6 100644 --- a/test/spec/modules/magniteAnalyticsAdapter_spec.js +++ b/test/spec/modules/magniteAnalyticsAdapter_spec.js @@ -2069,7 +2069,6 @@ describe('magnite analytics adapter', function () { bidResponse.requestId = 'fakeId'; bidResponse.seatBidId = 'fakeId'; - bidResponse.requestId = 'fakeId'; events.emit(AUCTION_INIT, auctionInit); events.emit(BID_REQUESTED, MOCK.BID_REQUESTED); From 3894aa29d29991d3f882b30dc98fc1a03206f917 Mon Sep 17 00:00:00 2001 From: Robert Ray Martinez III Date: Mon, 3 Apr 2023 10:27:58 -0700 Subject: [PATCH 7/8] minor changes --- modules/magniteAnalyticsAdapter.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/magniteAnalyticsAdapter.js b/modules/magniteAnalyticsAdapter.js index 18076bb00fa..5999b14e29f 100644 --- a/modules/magniteAnalyticsAdapter.js +++ b/modules/magniteAnalyticsAdapter.js @@ -955,6 +955,8 @@ magniteAdapter.track = ({ eventType, args }) => { const handleNonBidEvent = function(args) { const {seatnonbid, auctionId} = args; const auction = deepAccess(cache, `auctions.${auctionId}.auction`); + // if no auction just bail + if (!auction) logWarn(`Unable to match nonbid to auction`) && return; const adUnits = auction.adUnits; seatnonbid.forEach(seatnonbid => { let {seat} = seatnonbid; @@ -965,10 +967,10 @@ const handleNonBidEvent = function(args) { const adUnit = adUnits[matchingTid]; const statusInfo = statusMap[status] || { status: 'no-bid' }; adUnit.bids[generateUUID()] = { - source: 'server', bidder: seat, + source: 'server', isSeatNonBid: true, - clientLatencyMillis: Date.now() - cache.auctions[args.auctionId].auction.auctionStart, + clientLatencyMillis: Date.now() - auction.auctionStart, ...statusInfo }; } catch (error) { From 0d0f2754694df1fd41717f254750354691195453 Mon Sep 17 00:00:00 2001 From: Robert Ray Martinez III Date: Mon, 3 Apr 2023 10:32:49 -0700 Subject: [PATCH 8/8] doh --- modules/magniteAnalyticsAdapter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/magniteAnalyticsAdapter.js b/modules/magniteAnalyticsAdapter.js index 5999b14e29f..9d2f782744e 100644 --- a/modules/magniteAnalyticsAdapter.js +++ b/modules/magniteAnalyticsAdapter.js @@ -956,7 +956,10 @@ const handleNonBidEvent = function(args) { const {seatnonbid, auctionId} = args; const auction = deepAccess(cache, `auctions.${auctionId}.auction`); // if no auction just bail - if (!auction) logWarn(`Unable to match nonbid to auction`) && return; + if (!auction) { + logWarn(`Unable to match nonbid to auction`); + return; + } const adUnits = auction.adUnits; seatnonbid.forEach(seatnonbid => { let {seat} = seatnonbid;