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

Adagio Bid Adapter: handle meta.advertiserDomains and update version #6781

Merged
merged 1 commit into from
May 18, 2021
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
6 changes: 5 additions & 1 deletion modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { OUTSTREAM } from '../src/video.js';

export const BIDDER_CODE = 'adagio';
export const LOG_PREFIX = 'Adagio:';
export const VERSION = '2.8.0';
export const VERSION = '2.10.0';
export const FEATURES_VERSION = '1';
export const ENDPOINT = 'https://mp.4dex.io/prebid';
export const SUPPORTED_MEDIA_TYPES = [BANNER, NATIVE, VIDEO];
Expand Down Expand Up @@ -1019,6 +1019,10 @@ export const spec = {
const bidReq = (find(bidRequest.data.adUnits, bid => bid.bidId === bidObj.requestId));

if (bidReq) {
bidObj.meta = utils.deepAccess(bidObj, 'meta', {});
bidObj.meta.mediaType = bidObj.mediaType;
bidObj.meta.advertiserDomains = (Array.isArray(bidObj.aDomain) && bidObj.aDomain.length) ? bidObj.aDomain : [];

if (bidObj.mediaType === VIDEO) {
const mediaTypeContext = utils.deepAccess(bidReq, 'mediaTypes.video.context');
// Adagio SSP returns a `vastXml` only. No `vastUrl` nor `videoCacheKey`.
Expand Down
51 changes: 49 additions & 2 deletions test/spec/modules/adagioBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,14 @@ describe('Adagio bid adapter', () => {
netRevenue: true,
requestId: 'c180kg4267tyqz',
ttl: 360,
width: 300
width: 300,
aDomain: ['advertiser.com'],
mediaType: 'banner',
meta: {
advertiserId: '80',
advertiserName: 'An Advertiser',
networkId: '110'
}
}]
}
};
Expand Down Expand Up @@ -821,13 +828,53 @@ describe('Adagio bid adapter', () => {
pagetype: 'ARTICLE',
category: 'NEWS',
subcategory: 'SPORT',
environment: 'desktop'
environment: 'desktop',
aDomain: ['advertiser.com'],
mediaType: 'banner',
meta: {
advertiserId: '80',
advertiserName: 'An Advertiser',
advertiserDomains: ['advertiser.com'],
networkId: '110',
mediaType: 'banner'
}
}];

expect(spec.interpretResponse(serverResponse, bidRequest)).to.be.an('array');
expect(spec.interpretResponse(serverResponse, bidRequest)).to.deep.equal(expectedResponse);
});

it('Meta props should be limited if no bid.meta is provided', function() {
const altServerResponse = utils.deepClone(serverResponse);
delete altServerResponse.body.bids[0].meta;

let expectedResponse = [{
ad: '<div style="background-color:red; height:250px; width:300px"></div>',
cpm: 1,
creativeId: 'creativeId',
currency: 'EUR',
height: 250,
netRevenue: true,
requestId: 'c180kg4267tyqz',
ttl: 360,
width: 300,
placement: 'PAVE_ATF',
site: 'SITE-NAME',
pagetype: 'ARTICLE',
category: 'NEWS',
subcategory: 'SPORT',
environment: 'desktop',
aDomain: ['advertiser.com'],
mediaType: 'banner',
meta: {
advertiserDomains: ['advertiser.com'],
mediaType: 'banner'
}
}];

expect(spec.interpretResponse(altServerResponse, bidRequest)).to.deep.equal(expectedResponse);
});

it('should populate ADAGIO queue with ssp-data', function() {
sandbox.stub(Date, 'now').returns(12345);

Expand Down