Skip to content

Commit

Permalink
enrich adagio bid params
Browse files Browse the repository at this point in the history
  • Loading branch information
rotta-f committed Aug 10, 2023
1 parent f74a4b3 commit 5d957dd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ export const spec = {
const aucId = generateUUID()

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

// Fix https://github.com/prebid/Prebid.js/issues/9781
bidRequest.auctionId = aucId
Expand Down Expand Up @@ -1118,15 +1118,24 @@ export const spec = {
// remove useless props
delete adUnitCopy.floorData;
delete adUnitCopy.params.siteId;
delete adUnitCopy.userId
delete adUnitCopy.userIdAsEids
delete adUnitCopy.userId;
delete adUnitCopy.userIdAsEids;
// delete adUnitCopy.params.adagioAuctionId;

groupedAdUnits[adUnitCopy.params.organizationId] = groupedAdUnits[adUnitCopy.params.organizationId] || [];
groupedAdUnits[adUnitCopy.params.organizationId].push(adUnitCopy);

return groupedAdUnits;
}, {});

// Adding more params on the original bid object.
// Those params are not sent to the server.
// They are used for further operations on analytics adapter.
validBidRequests.forEach(rawBidRequest => {
rawBidRequest.params.adagioAuctionId = aucId
rawBidRequest.params.pageviewId = pageviewId
});

// Build one request per organizationId
const requests = _map(Object.keys(groupedAdUnits), organizationId => {
return {
Expand Down

0 comments on commit 5d957dd

Please sign in to comment.