Skip to content

Prebid 7: Adapter fixes for reading impression position #8451

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

Merged
merged 18 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
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
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