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

GumGum: adds new param #5297

Merged
merged 2 commits into from
Jun 9, 2020
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
7 changes: 6 additions & 1 deletion modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
21 changes: 21 additions & 0 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down