From 000ffd8235dbdd697d4143dbfb6ce8501f6a5a49 Mon Sep 17 00:00:00 2001 From: Michael Moschovas Date: Fri, 16 Apr 2021 15:41:58 -0400 Subject: [PATCH] FPD Update - Core/RP Analytics Adapter 1) Update core to convert adUnits passed into requestBids (previously only global) 2) Update to RP Analytics adapter to look in ortb2Imp instead of legacy fpd --- modules/rubiconAnalyticsAdapter.js | 8 ++++---- src/prebid.js | 2 +- .../spec/modules/rubiconAnalyticsAdapter_spec.js | 16 ++++++++++------ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/modules/rubiconAnalyticsAdapter.js b/modules/rubiconAnalyticsAdapter.js index 74f098c0292..f06af144b54 100644 --- a/modules/rubiconAnalyticsAdapter.js +++ b/modules/rubiconAnalyticsAdapter.js @@ -662,12 +662,12 @@ let rubiconAdapter = Object.assign({}, baseAdapter, { return ['banner']; }, 'gam', () => { - if (utils.deepAccess(bid, 'fpd.context.adServer.name') === 'gam') { - return {adSlot: bid.fpd.context.adServer.adSlot} + if (utils.deepAccess(bid, 'ortb2Imp.ext.data.adserver.name') === 'gam') { + return {adSlot: bid.ortb2Imp.ext.data.adserver.adSlot} } }, - 'pbAdSlot', () => utils.deepAccess(bid, 'fpd.context.pbAdSlot'), - 'pattern', () => utils.deepAccess(bid, 'fpd.context.aupName') + 'pbAdSlot', () => utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot'), + 'pattern', () => utils.deepAccess(bid, 'ortb2Imp.ext.data.aupname') ]) ]); return memo; diff --git a/src/prebid.js b/src/prebid.js index 7211371366e..8c5e465174f 100644 --- a/src/prebid.js +++ b/src/prebid.js @@ -502,7 +502,7 @@ $$PREBID_GLOBAL$$.removeAdUnit = function (adUnitCode) { $$PREBID_GLOBAL$$.requestBids = hook('async', function ({ bidsBackHandler, timeout, adUnits, adUnitCodes, labels, auctionId } = {}) { events.emit(REQUEST_BIDS); const cbTimeout = timeout || config.getConfig('bidderTimeout'); - adUnits = adUnits || $$PREBID_GLOBAL$$.adUnits; + adUnits = (adUnits && config.convertAdUnitFpd(utils.isArray(adUnits) ? adUnits : [adUnits])) || $$PREBID_GLOBAL$$.adUnits; utils.logInfo('Invoking $$PREBID_GLOBAL$$.requestBids', arguments); diff --git a/test/spec/modules/rubiconAnalyticsAdapter_spec.js b/test/spec/modules/rubiconAnalyticsAdapter_spec.js index 84315dd1eba..3cfaa448472 100644 --- a/test/spec/modules/rubiconAnalyticsAdapter_spec.js +++ b/test/spec/modules/rubiconAnalyticsAdapter_spec.js @@ -1906,14 +1906,18 @@ describe('rubicon analytics adapter', function () { it('should pass aupName as pattern', function () { let bidRequest = utils.deepClone(MOCK.BID_REQUESTED); - bidRequest.bids[0].fpd = { - context: { - aupName: '1234/mycoolsite/*&gpt_leaderboard&deviceType=mobile' + bidRequest.bids[0].ortb2Imp = { + ext: { + data: { + aupname: '1234/mycoolsite/*&gpt_leaderboard&deviceType=mobile' + } } }; - bidRequest.bids[1].fpd = { - context: { - aupName: '1234/mycoolsite/*&gpt_skyscraper&deviceType=mobile' + bidRequest.bids[1].ortb2Imp = { + ext: { + data: { + aupname: '1234/mycoolsite/*&gpt_skyscraper&deviceType=mobile' + } } }; events.emit(AUCTION_INIT, MOCK.AUCTION_INIT);