diff --git a/integrationExamples/gpt/pbjs_example_gpt.html b/integrationExamples/gpt/pbjs_example_gpt.html index dcc67ae0f74..32452d33fd9 100644 --- a/integrationExamples/gpt/pbjs_example_gpt.html +++ b/integrationExamples/gpt/pbjs_example_gpt.html @@ -300,7 +300,8 @@ bidder: 'zedo', params: { channelCode: 2264002816, //REQUIRED - dimId: 9 //REQUIRED + dimId: 9, //REQUIRED + pubId: 1 // OPTIONAL } }, { diff --git a/modules/zedoBidAdapter.js b/modules/zedoBidAdapter.js index db65f147698..b09913ecf60 100644 --- a/modules/zedoBidAdapter.js +++ b/modules/zedoBidAdapter.js @@ -60,6 +60,7 @@ export const spec = { id: bidRequest.bidId, network: network, channel: channel, + publisher: bidRequest.params.pubId ? bidRequest.params.pubId : 0, width: dim[0], height: dim[1], dimension: bidRequest.params.dimId, @@ -258,11 +259,12 @@ function videoRenderer(bid) { bid.renderer.push(() => { let channelCode = utils.deepAccess(bid, 'params.0.channelCode') || 0; let dimId = utils.deepAccess(bid, 'params.0.dimId') || 0; + let publisher = utils.deepAccess(bid, 'params.0.pubId') || 0; let options = utils.deepAccess(bid, 'params.0.options') || {}; let channel = (channelCode > 0) ? (channelCode - (bid.network * 1000000)) : 0; var rndr = new ZdPBTag(bid.adUnitCode, bid.network, bid.width, bid.height, bid.adType, bid.vastXml, channel, dimId, (encodeURI(utils.getTopWindowUrl()) || ''), options); - rndr.renderAd(); + rndr.renderAd(publisher); }); } @@ -288,18 +290,19 @@ function getLoggingData(eid, data) { data = (utils.isArray(data) && data) || []; let params = {}; - let channel, network, dim, adunitCode, timeToRespond, cpm; + let channel, network, dim, publisher, adunitCode, timeToRespond, cpm; data.map((adunit) => { adunitCode = adunit.adUnitCode; channel = utils.deepAccess(adunit, 'params.0.channelCode') || 0; network = channel > 0 ? parseInt(channel / 1000000) : 0; dim = utils.deepAccess(adunit, 'params.0.dimId') * 256 || 0; + publisher = utils.deepAccess(adunit, 'params.0.pubId') || 0; timeToRespond = adunit.timeout ? adunit.timeout : adunit.timeToRespond; cpm = adunit.cpm; }); params.n = network; params.c = channel; - params.s = '0'; + params.s = publisher; params.x = dim; params.ai = encodeURI('Prebid^zedo^' + adunitCode + '^' + cpm + '^' + timeToRespond); params.pu = encodeURI(utils.getTopWindowUrl()) || ''; diff --git a/modules/zedoBidAdapter.md b/modules/zedoBidAdapter.md index 1ea35585a64..e0f9101deaa 100644 --- a/modules/zedoBidAdapter.md +++ b/modules/zedoBidAdapter.md @@ -26,8 +26,9 @@ ZEDO has its own renderer and will render the video unit if not defined in the c { bidder: 'zedo', params: { - channelCode: 2264004118 - dimId: 9 + channelCode: 2264004118, // required + dimId: 9, // required + pubId: 1 // optional } } ] @@ -53,8 +54,9 @@ ZEDO has its own renderer and will render the video unit if not defined in the c bidder: 'zedo', params: { - channelCode: 2264004593, - dimId: 85 + channelCode: 2264004593, // required + dimId: 85, // required + pubId: 1 // optional } } ] diff --git a/test/spec/modules/zedoBidAdapter_spec.js b/test/spec/modules/zedoBidAdapter_spec.js index 8e6578d9b2c..76301ba9018 100644 --- a/test/spec/modules/zedoBidAdapter_spec.js +++ b/test/spec/modules/zedoBidAdapter_spec.js @@ -38,7 +38,8 @@ describe('The ZEDO bidding adapter', function () { sizes: [[300, 200]], params: { channelCode: 20000000, - dimId: 10 + dimId: 10, + pubId: 1 }, }, ]; @@ -46,7 +47,7 @@ describe('The ZEDO bidding adapter', function () { expect(request.url).to.match(/^\/\/saxp.zedo.com\/asw\/fmh.json/); expect(request.method).to.equal('GET'); const zedoRequest = request.data; - expect(zedoRequest).to.equal('g={"placements":[{"network":20,"channel":0,"width":300,"height":200,"dimension":10,"version":"$prebid.version$","keyword":"","transactionId":"12345667","renderers":[{"name":"display"}]}]}'); + expect(zedoRequest).to.equal('g={"placements":[{"network":20,"channel":0,"publisher":1,"width":300,"height":200,"dimension":10,"version":"$prebid.version$","keyword":"","transactionId":"12345667","renderers":[{"name":"display"}]}]}'); }); it('should properly build a channelCode request for video with type defined', function () { @@ -71,7 +72,7 @@ describe('The ZEDO bidding adapter', function () { expect(request.url).to.match(/^\/\/saxp.zedo.com\/asw\/fmh.json/); expect(request.method).to.equal('GET'); const zedoRequest = request.data; - expect(zedoRequest).to.equal('g={"placements":[{"network":20,"channel":0,"width":640,"height":480,"dimension":85,"version":"$prebid.version$","keyword":"","transactionId":"12345667","renderers":[{"name":"Inarticle"}]}]}'); + expect(zedoRequest).to.equal('g={"placements":[{"network":20,"channel":0,"publisher":0,"width":640,"height":480,"dimension":85,"version":"$prebid.version$","keyword":"","transactionId":"12345667","renderers":[{"name":"Inarticle"}]}]}'); }); describe('buildGDPRRequests', function () { @@ -100,7 +101,7 @@ describe('The ZEDO bidding adapter', function () { const request = spec.buildRequests(bidRequests, bidderRequest); expect(request.method).to.equal('GET'); const zedoRequest = request.data; - expect(zedoRequest).to.equal('g={"placements":[{"network":20,"channel":0,"width":300,"height":200,"dimension":10,"version":"$prebid.version$","keyword":"","transactionId":"12345667","renderers":[{"name":"display"}]}],"gdpr":1,"gdpr_consent":"BOJ8RZsOJ8RZsABAB8AAAAAZ+A=="}'); + expect(zedoRequest).to.equal('g={"placements":[{"network":20,"channel":0,"publisher":0,"width":300,"height":200,"dimension":10,"version":"$prebid.version$","keyword":"","transactionId":"12345667","renderers":[{"name":"display"}]}],"gdpr":1,"gdpr_consent":"BOJ8RZsOJ8RZsABAB8AAAAAZ+A=="}'); }); }); });