Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive Offers Bid Adapter: new fields and remap on the internal object #7946

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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