Skip to content

Commit

Permalink
Update openrtb bid response fields
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlane committed Feb 12, 2018
1 parent bc031c5 commit 5a02b24
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions modules/prebidServerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ const LEGACY_PROTOCOL = {
} else if (bidObj.adm) {
bidObject.ad = bidObj.adm;
} else if (bidObj.nurl) {
bidObject.adUrl = bidObj.nurl
bidObject.adUrl = bidObj.nurl;
}
}

Expand All @@ -355,11 +355,6 @@ const LEGACY_PROTOCOL = {
bids.push({ adUnit: bidObj.code, bid: bidObject });
});
}

if (result.status === 'no_cookie' && _s2sConfig.cookieSet && typeof _s2sConfig.cookieSetUrl === 'string') {
// cookie sync
cookieSet(_s2sConfig.cookieSetUrl);
}
}

return bids;
Expand Down Expand Up @@ -422,13 +417,23 @@ const OPEN_RTB_PROTOCOL = {
let bidObject = bidfactory.createBid(status);

bidObject.source = TYPE;
bidObject.creative_id = bid.crid;
bidObject.bidderCode = seatbid.seat;
bidObject.cpm = cpm;
bidObject.ad = bid.adm;

if (bid.adm && bid.nurl) {
bidObject.ad = bid.adm;
bidObject.ad += utils.createTrackPixelHtml(decodeURIComponent(bid.nurl));
} else if (bid.adm) {
bidObject.ad = bid.adm;
} else if (bid.nurl) {
bidObject.adUrl = bid.nurl;
}

bidObject.width = bid.w;
bidObject.height = bid.h;
if (bid.dealid) { bidObject.dealId = bid.dealid; }
bidObject.requestId = bid.id;
bidObject.creative_id = bid.crid;
bidObject.creativeId = bid.crid;

// TODO: Remove when prebid-server returns ttl, currency and netRevenue
Expand Down Expand Up @@ -525,7 +530,7 @@ export function PrebidServer() {
}
});

if (result.status === 'no_cookie' && typeof _s2sConfig.cookieSetUrl === 'string') {
if (result.status === 'no_cookie' && _s2sConfig.cookieSet && typeof _s2sConfig.cookieSetUrl === 'string') {
// cookie sync
cookieSet(_s2sConfig.cookieSetUrl);
}
Expand Down

0 comments on commit 5a02b24

Please sign in to comment.