From 092056cd1864151ba3852eebf3b92e22beb244ce Mon Sep 17 00:00:00 2001 From: Susan Date: Fri, 22 May 2020 14:55:11 -0700 Subject: [PATCH 1/2] adds in new videoPubID param --- modules/gumgumBidAdapter.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 273ecd44022..91f79761da1 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -139,7 +139,7 @@ function isBidRequestValid (bid) { case !!(params.ICV): break; case !!(params.video): break; case !!(params.inVideo): break; - + case !!(params.videoPubID): break; default: utils.logWarn(`[GumGum] No product selected for the placement ${adUnitCode}, please check your implementation.`); return false; @@ -234,6 +234,11 @@ function buildRequests (validBidRequests, bidderRequest) { data.ni = parseInt(params.ICV, 10); data.pi = 5; } + if (params.videoPubID) { + data = Object.assign(data, _getVidParams(mediaTypes.video)); + data.pubId = params.videoPubID; + data.pi = 7; + } if (params.video) { data = Object.assign(data, _getVidParams(mediaTypes.video)); data.t = params.video; From 7ff16b899afa0f370b97815878bac02a60be87bd Mon Sep 17 00:00:00 2001 From: Susan Date: Fri, 22 May 2020 14:55:20 -0700 Subject: [PATCH 2/2] adds test --- test/spec/modules/gumgumBidAdapter_spec.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index c2fb7f26559..9136c0e6b9e 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -129,6 +129,27 @@ describe('gumgumAdapter', function () { expect(bidRequest.data.pubId).to.equal(request.params.inScreenPubID); expect(bidRequest.data).to.not.include.any.keys('t'); }); + it('should send pubId if videoPubID param is specified', function () { + const mediaTypes = { + video: { + playerSize: [640, 480], + context: 'instream', + minduration: 1, + maxduration: 2, + linearity: 1, + startdelay: 1, + placement: 123456, + protocols: [1, 2] + } + }; + const request = Object.assign({}, bidRequests[0]); + request.mediaTypes = mediaTypes + request.params = { 'videoPubID': 123 }; + const bidRequest = spec.buildRequests([request])[0]; + expect(bidRequest.data).to.include.any.keys('pubId'); + expect(bidRequest.data.pubId).to.equal(request.params.videoPubID); + expect(bidRequest.data).to.not.include.any.keys('t'); + }); it('should set a ni parameter in bid request if ICV request param is found', function () { const request = Object.assign({}, bidRequests[0]); delete request.params;