Skip to content

Commit

Permalink
InteractiveOffers - New fields and remap on the internal object (preb…
Browse files Browse the repository at this point in the history
  • Loading branch information
IOTiagoFaria authored and avj83 committed Jan 24, 2022
1 parent 836f37f commit 732e24b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions modules/interactiveOffersBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ function parseRequestPrebidjsToOpenRTB(prebidRequest) {
let openRTBRequest = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequest']));
openRTBRequest.id = prebidRequest.auctionId;
openRTBRequest.ext = {
auctionstart: Date.now()
refererInfo: prebidRequest.refererInfo,
auctionId: prebidRequest.auctionId
};

openRTBRequest.site = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequestSite']));
Expand Down Expand Up @@ -111,15 +112,17 @@ function parseRequestPrebidjsToOpenRTB(prebidRequest) {
openRTBRequest.user = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequestUser']));

openRTBRequest.imp = [];
prebidRequest.bids.forEach(function(bid, impId) {
impId++;
prebidRequest.bids.forEach(function(bid) {
if (!ret.partnerId) {
ret.partnerId = bid.params.partnerId;
}
let imp = JSON.parse(JSON.stringify(DEFAULT['OpenRTBBidRequestImp']));
imp.id = impId;
imp.id = bid.bidId;
imp.secure = secure;
imp.tagid = bid.bidId;
imp.tagid = bid.adUnitCode;
imp.ext = {
rawdata: bid
};

openRTBRequest.site.publisher.id = openRTBRequest.site.publisher.id || 0;
openRTBRequest.tmax = openRTBRequest.tmax || bid.params.tmax || 0;
Expand Down Expand Up @@ -152,7 +155,7 @@ function parseResponseOpenRTBToPrebidjs(openRTBResponse) {
if (seatbid.bid && seatbid.bid.forEach) {
seatbid.bid.forEach(function(bid) {
let prebid = JSON.parse(JSON.stringify(DEFAULT['PrebidBid']));
prebid.requestId = bid.ext.tagid;
prebid.requestId = bid.impid;
prebid.ad = bid.adm;
prebid.creativeId = bid.crid;
prebid.cpm = bid.price;
Expand Down

0 comments on commit 732e24b

Please sign in to comment.