Skip to content

Commit

Permalink
Prebid 7: Adapter fixes for reading impression position (#8451)
Browse files Browse the repository at this point in the history
* Update gamoshiBidAdapter.js

* Update waardexBidAdapter.js

* Update pixfutureBidAdapter.js

* Update smilewantedBidAdapter.js

* Update adrelevantisBidAdapter.js

* Update spotxBidAdapter.js

* Update spotxBidAdapter.js

* Update spotxBidAdapter.js

* Update smilewantedBidAdapter.js

* Update smilewantedBidAdapter.js

* Update smilewantedBidAdapter.js

* Update gamoshiBidAdapter.js

* Update waardexBidAdapter.js

* Update waardexBidAdapter.js

* Update gamoshiBidAdapter.js

* Update gamoshiBidAdapter.js

* Update waardexBidAdapter.js

* Update waardexBidAdapter.js
  • Loading branch information
patmmccann authored May 26, 2022
1 parent 823fa5a commit 187c0d0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
7 changes: 7 additions & 0 deletions modules/adrelevantisBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,13 @@ function bidToTag(bid) {
tag.disable_psa = true;
if (bid.params.position) {
tag.position = {'above': 1, 'below': 2}[bid.params.position] || 0;
} else {
let mediaTypePos = deepAccess(bid, `mediaTypes.banner.pos`) || deepAccess(bid, `mediaTypes.video.pos`);
// only support unknown, atf, and btf values for position at this time
if (mediaTypePos === 0 || mediaTypePos === 1 || mediaTypePos === 3) {
// ortb spec treats btf === 3, but our system interprets btf === 2; so converting the ortb value here for consistency
tag.position = (mediaTypePos === 3) ? 2 : mediaTypePos;
}
}
if (bid.params.trafficSourceCode) {
tag.traffic_source_code = bid.params.trafficSourceCode;
Expand Down
6 changes: 3 additions & 3 deletions modules/gamoshiBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const spec = {

const imp = {
id: transactionId,
instl: deepAccess(bidRequest.ortb2Imp, 'instl') === 1 || params.instl === 1 ? 1 : 0,
instl: deepAccess(bidderRequest.ortb2Imp, 'instl') === 1 || params.instl === 1 ? 1 : 0,
tagid: adUnitCode,
bidfloor: helper.getBidFloor(bidRequest) || 0,
bidfloorcur: 'USD',
Expand All @@ -143,7 +143,7 @@ export const spec = {
banner: {
w: sizes.length ? sizes[0][0] : 300,
h: sizes.length ? sizes[0][1] : 250,
pos: params.pos || 0,
pos: deepAccess(bidderRequest, 'mediaTypes.banner.pos') || params.pos || 0,
topframe: inIframe() ? 0 : 1
}
});
Expand All @@ -157,7 +157,7 @@ export const spec = {
const videoImp = Object.assign({}, imp, {
video: {
protocols: bidRequest.mediaTypes.video.protocols || params.protocols || [1, 2, 3, 4, 5, 6],
pos: params.pos || 0,
pos: deepAccess(bidRequest, 'mediaTypes.video.pos') || params.pos || 0,
ext: {
context: mediaTypes.video.context
},
Expand Down
7 changes: 7 additions & 0 deletions modules/pixfutureBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ function bidToTag(bid) {
}
if (bid.params.position) {
tag.position = {'above': 1, 'below': 2}[bid.params.position] || 0;
} else {
let mediaTypePos = deepAccess(bid, `mediaTypes.banner.pos`) || deepAccess(bid, `mediaTypes.video.pos`);
// only support unknown, atf, and btf values for position at this time
if (mediaTypePos === 0 || mediaTypePos === 1 || mediaTypePos === 3) {
// ortb spec treats btf === 3, but our system interprets btf === 2; so converting the ortb value here for consistency
tag.position = (mediaTypePos === 3) ? 2 : mediaTypePos;
}
}
if (bid.params.trafficSourceCode) {
tag.traffic_source_code = bid.params.trafficSourceCode;
Expand Down
5 changes: 5 additions & 0 deletions modules/smilewantedBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export const spec = {
transactionId: bid.transactionId,
timeout: config.getConfig('bidderTimeout'),
bidId: bid.bidId,
/** positionType is undocumented
It is unclear what this parameter means.
If it means the same as pos in openRTB,
It should read from openRTB object
or from mediaTypes.banner.pos */
positionType: bid.params.positionType || '',
prebidVersion: '$prebid.version$'
};
Expand Down
4 changes: 4 additions & 0 deletions modules/spotxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ export const spec = {

if (getBidIdParameter('position', bid.params) != '') {
spotxReq.video.ext.pos = getBidIdParameter('position', bid.params);
} else {
if (deepAccess(bid, 'mediaTypes.video.pos')) {
spotxReq.video.ext.pos = deepAccess(bid, 'mediaTypes.video.pos');
}
}

if (bid.crumbs && bid.crumbs.pubcid) {
Expand Down

0 comments on commit 187c0d0

Please sign in to comment.