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

Provide more data in Adhese bid response #5154

Merged
merged 13 commits into from
Apr 28, 2020
Merged
6 changes: 5 additions & 1 deletion modules/adheseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,15 @@ function getAdDetails(ad) {
if (isAdheseAd(ad)) {
creativeId = ad.id;
dealId = ad.orderId;
originData = { priority: ad.priority, orderProperty: ad.orderProperty, adFormat: ad.adFormat, adType: ad.adType, libId: ad.libId, adspaceId: ad.adspaceId, viewableImpressionCounter: ad.viewableImpressionCounter };
originData = { priority: ad.priority, orderProperty: ad.orderProperty, adFormat: ad.adFormat, adType: ad.adType, libId: ad.libId, adspaceId: ad.adspaceId, viewableImpressionCounter: ad.viewableImpressionCounter, slotId: ad.slotID, slotName: ad.slotName, advertiserId: ad.advertiserId, adId: ad.id };
} else {
creativeId = ad.origin + (ad.originInstance ? '-' + ad.originInstance : '');
if (ad.originData) {
originData = ad.originData;
originData.slotId = ad.slotID;
originData.slotName = ad.slotName;
originData.adType = ad.adType;
if (ad.adFormat) originData.adFormat = ad.adFormat;
if (ad.originData.seatbid && ad.originData.seatbid.length) {
const seatbid = ad.originData.seatbid[0];
if (seatbid.bid && seatbid.bid.length) {
Expand Down
18 changes: 15 additions & 3 deletions test/spec/modules/adheseBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ describe('AdheseAdapter', function () {
origin: 'APPNEXUS',
originInstance: '',
ext: 'js',
slotID: '10',
slotName: '_main_page_-leaderboard',
adType: 'leaderboard',
originData: {
Expand Down Expand Up @@ -155,12 +156,15 @@ describe('AdheseAdapter', function () {
ttl: TTL,
adhese: {
originData: {
adType: 'leaderboard',
seatbid: [
{
bid: [ { crid: '60613369', dealid: null } ],
seat: '958'
}
]
],
slotId: '10',
slotName: '_main_page_-leaderboard'
}
}
}];
Expand Down Expand Up @@ -249,12 +253,16 @@ describe('AdheseAdapter', function () {
adhese: {
originData: {
adFormat: 'largeleaderboard',
adId: '742898',
adType: 'largeleaderboard',
adspaceId: '162363',
libId: '90511',
orderProperty: undefined,
priority: undefined,
viewableImpressionCounter: undefined
viewableImpressionCounter: undefined,
slotId: '29306',
slotName: '_main_page_-leaderboard',
advertiserId: '2081'
}
},
cpm: 5.96,
Expand Down Expand Up @@ -304,12 +312,16 @@ describe('AdheseAdapter', function () {
adhese: {
originData: {
adFormat: '',
adId: '742470',
adType: 'preroll',
adspaceId: '164196',
libId: '89860',
orderProperty: undefined,
priority: undefined,
viewableImpressionCounter: undefined
viewableImpressionCounter: undefined,
slotId: '41711',
slotName: '_main_page_-leaderboard',
advertiserId: '2263',
}
},
cpm: 0,
Expand Down