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

Jixie Bid Adapter: add support for advertiserDomains #6898

Merged
merged 4 commits into from
Jun 2, 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: 10 additions & 0 deletions modules/jixieBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ export const spec = {
let rendererScript = (oneBid.osparams.script ? oneBid.osparams.script : JX_OUTSTREAM_RENDERER_URL);
bnd.renderer = createRenderer_(oneBid, rendererScript, jxOutstreamRender_);
}
// a note on advertiserDomains: our adserver is not responding in
// openRTB-type json. so there is no need to copy from 'adomain' over
// to meta: advertiserDomains
// However, we will just make sure the property is there.
if (!bnd.meta) {
bnd.meta = {};
}
if (!bnd.meta.advertiserDomains) {
bnd.meta.advertiserDomains = [];
}
bidResponses.push(bnd);
});
if (response.body.setids) {
Expand Down
9 changes: 8 additions & 1 deletion test/spec/modules/jixieBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ describe('jixie Adapter', function () {
},
'vastUrl': 'https://ad.jixie.io/v1/video?creativeid=522'
},
// display ad returned here:
// display ad returned here: This one there is advertiserDomains
// in the response . Will be checked in the unit tests below
{
'trackingUrlBase': 'https://tr.jixie.io/sync/ad?',
'jxBidId': '600c9ae6fda1acb-028d5dee-2c83-44e3-bed1-b75002475cdf',
Expand Down Expand Up @@ -411,6 +412,9 @@ describe('jixie Adapter', function () {
expect(result[0].ttl).to.equal(300)
expect(result[0].vastUrl).to.include('https://ad.jixie.io/v1/video?creativeid=')
expect(result[0].trackingUrlBase).to.include('sync')
// We will always make sure the meta->advertiserDomains property is there
// If no info it is an empty array.
expect(result[0].meta.advertiserDomains.length).to.equal(0)

// display ad
expect(result[1].requestId).to.equal('600c9ae6fda1acb')
Expand All @@ -422,6 +426,7 @@ describe('jixie Adapter', function () {
expect(result[1].netRevenue).to.equal(true)
expect(result[1].ttl).to.equal(300)
expect(result[1].ad).to.include('jxoutstream')
expect(result[1].meta.advertiserDomains.length).to.equal(3)
expect(result[1].trackingUrlBase).to.include('sync')

// should pick up about using alternative outstream renderer
Expand All @@ -436,6 +441,7 @@ describe('jixie Adapter', function () {
expect(result[2].vastXml).to.include('<?xml version="1.0" encoding="UTF-8"?>')
expect(result[2].trackingUrlBase).to.include('sync');
expect(result[2].renderer.id).to.equal('demoslot4-div')
expect(result[2].meta.advertiserDomains.length).to.equal(0)
expect(result[2].renderer.url).to.equal(JX_OTHER_OUTSTREAM_RENDERER_URL);

// should know to use default outstream renderer
Expand All @@ -450,6 +456,7 @@ describe('jixie Adapter', function () {
expect(result[3].vastXml).to.include('<?xml version="1.0" encoding="UTF-8"?>')
expect(result[3].trackingUrlBase).to.include('sync');
expect(result[3].renderer.id).to.equal('demoslot2-div')
expect(result[3].meta.advertiserDomains.length).to.equal(0)
expect(result[3].renderer.url).to.equal(JX_OUTSTREAM_RENDERER_URL)

setLocalStorageSpy.restore();
Expand Down