Skip to content

Commit

Permalink
AdagioBidAdapter: fix floor price module support (prebid#10711)
Browse files Browse the repository at this point in the history
  • Loading branch information
osazos authored Nov 10, 2023
1 parent fe5fbb7 commit 2aadc09
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {find} from '../src/polyfill.js';
import {
_map,
cleanObj,
deepAccess,
deepClone,
Expand Down Expand Up @@ -570,6 +569,7 @@ function _parseNativeBidResponse(bid) {
bid.native = native
}

// bidRequest param must be the `bidRequest` object with the original `auctionId` value.
function _getFloors(bidRequest) {
if (!isFn(bidRequest.getFloor)) {
return false;
Expand Down Expand Up @@ -996,7 +996,7 @@ export const spec = {

const aucId = generateUUID()

const adUnits = _map(validBidRequests, (rawBidRequest) => {
const adUnits = validBidRequests.map(rawBidRequest => {
const bidRequest = deepClone(rawBidRequest);

// Fix https://github.com/prebid/Prebid.js/issues/9781
Expand Down Expand Up @@ -1068,7 +1068,10 @@ export const spec = {
});

// Handle priceFloors module
const computedFloors = _getFloors(bidRequest);
// We need to use `rawBidRequest` as param because:
// - adagioBidAdapter generates its own auctionId due to transmitTid activity limitation (see https://github.com/prebid/Prebid.js/pull/10079)
// - the priceFloors.getFloor() uses a `_floorDataForAuction` map to store the floors based on the auctionId.
const computedFloors = _getFloors(rawBidRequest);
if (isArray(computedFloors) && computedFloors.length) {
bidRequest.floors = computedFloors

Expand Down Expand Up @@ -1149,7 +1152,7 @@ export const spec = {
});

// Build one request per organizationId
const requests = _map(Object.keys(groupedAdUnits), organizationId => {
const requests = Object.keys(groupedAdUnits).map(organizationId => {
return {
method: 'POST',
url: ENDPOINT,
Expand Down

0 comments on commit 2aadc09

Please sign in to comment.