diff --git a/integrationExamples/gpt/pbjs_example_gpt.html b/integrationExamples/gpt/pbjs_example_gpt.html index 6852b9f680a..dcc67ae0f74 100644 --- a/integrationExamples/gpt/pbjs_example_gpt.html +++ b/integrationExamples/gpt/pbjs_example_gpt.html @@ -418,7 +418,8 @@ { bidder: 'gumgum', params: { - inScreen: 'ggumtest' // REQUIRED str Tracking Id + inScreen: 'ggumtest', // REQUIRED str Tracking Id + bidfloor: 0.01 // OPTIONAL number CPM bid } }, { diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 9702eb14f0c..f66d056fb49 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -103,6 +103,12 @@ function isBidRequestValid (bid) { utils.logWarn(`[GumGum] No product selected for the placement ${adUnitCode}, please check your implementation.`); return false; } + + if (params.bidfloor && !(typeof params.bidfloor === 'number' && isFinite(params.bidfloor))) { + utils.logWarn('[GumGum] bidfloor must be a Number'); + return false; + } + return true; } @@ -126,6 +132,9 @@ function buildRequests (validBidRequests, bidderRequest) { if (pageViewId) { data.pv = pageViewId } + if (params.bidfloor) { + data.fp = params.bidfloor; + } if (params.inScreen) { data.t = params.inScreen; data.pi = 2; diff --git a/modules/gumgumBidAdapter.md b/modules/gumgumBidAdapter.md index 14f2fe40abb..57616a90ac2 100644 --- a/modules/gumgumBidAdapter.md +++ b/modules/gumgumBidAdapter.md @@ -20,7 +20,8 @@ var adUnits = [ { bidder: 'gumgum', params: { - inSlot: '15901' // GumGum Slot ID given to the client + inSlot: '15901', // GumGum Slot ID given to the client, + bidFloor: 0.03 // CPM bid floor } } ] @@ -31,7 +32,8 @@ var adUnits = [ { bidder: 'gumgum', params: { - inScreen: 'dc9d6be1' // GumGum Zone ID given to the client + inScreen: 'dc9d6be1', // GumGum Zone ID given to the client + bidFloor: 0.03 // CPM bid floor } } ] diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index 0c1431b71a5..c067f50fa56 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -17,7 +17,8 @@ describe('gumgumAdapter', function () { let bid = { 'bidder': 'gumgum', 'params': { - 'inScreen': '10433394' + 'inScreen': '10433394', + 'bidfloor': 0.05 }, 'adUnitCode': 'adunit-code', 'sizes': [[300, 250], [300, 600], [1, 1]], @@ -40,7 +41,7 @@ describe('gumgumAdapter', function () { expect(spec.isBidRequestValid(bid)).to.equal(true); }); - it('should return false when required params are not passed', function () { + it('should return false when no unit type is specified', function () { let bid = Object.assign({}, bid); delete bid.params; bid.params = { @@ -48,6 +49,16 @@ describe('gumgumAdapter', function () { }; expect(spec.isBidRequestValid(bid)).to.equal(false); }); + + it('should return false when bidfloor is not a number', function () { + let bid = Object.assign({}, bid); + delete bid.params; + bid.params = { + 'inSlot': '789', + 'bidfloor': '0.50' + }; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); }); describe('buildRequests', function () {