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

Yieldmo adapter: add meta data to bids #6550

Merged
merged 1 commit into from
Apr 8, 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
10 changes: 9 additions & 1 deletion modules/yieldmoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ function createNewBannerBid(response) {
netRevenue: NET_REVENUE,
ttl: TIME_TO_LIVE,
ad: response.ad,
meta: {
advertiserDomains: response.adomain || [],
mediaType: BANNER,
},
};
}

Expand All @@ -209,7 +213,11 @@ function createNewVideoBid(response, bidRequest) {
netRevenue: NET_REVENUE,
mediaType: VIDEO,
ttl: TIME_TO_LIVE,
vastXml: response.adm
vastXml: response.adm,
meta: {
advertiserDomains: response.adomain || [],
mediaType: VIDEO,
},
};
}

Expand Down
54 changes: 54 additions & 0 deletions test/spec/modules/yieldmoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ describe('YieldmoAdapter', function () {
ad: '<html><head></head><body><script>//GEX ad object</script>' +
'<div id="ym_123" class="ym"></div><script>//js code</script></body></html>',
creative_id: '9874652394875',
adomain: ['www.example.com'],
}],
header: 'header?',
});
Expand All @@ -296,6 +297,59 @@ describe('YieldmoAdapter', function () {
ttl: 300,
ad: '<html><head></head><body><script>//GEX ad object</script>' +
'<div id="ym_123" class="ym"></div><script>//js code</script></body></html>',
meta: {
advertiserDomains: ['www.example.com'],
mediaType: 'banner',
},
});
});

it('should correctly reorder video bids', function () {
const response = mockServerResponse();
const seatbid = [
{
bid: {
adm: '<?xml version="1.0" encoding="UTF-8"?>',
adomain: ['www.example.com'],
crid: 'dd65c0a7536aff',
impid: '91ea8bba1',
price: 1.5,
},
},
];
const bidRequest = {
data: {
imp: [
{
id: '91ea8bba1',
video: {
h: 250,
w: 300,
},
},
],
},
};

response.body.seatbid = seatbid;

const newResponse = spec.interpretResponse(response, bidRequest);
expect(newResponse.length).to.be.equal(2);
expect(newResponse[1]).to.deep.equal({
cpm: 1.5,
creativeId: 'dd65c0a7536aff',
currency: 'USD',
height: 250,
mediaType: 'video',
meta: {
advertiserDomains: ['www.example.com'],
mediaType: 'video',
},
netRevenue: true,
requestId: '91ea8bba1',
ttl: 300,
vastXml: '<?xml version="1.0" encoding="UTF-8"?>',
width: 300,
});
});

Expand Down