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

We want to remove bidfloor if not set by pb #3866

Merged
merged 1 commit into from
May 29, 2019
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
5 changes: 4 additions & 1 deletion modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ export const spec = {
},
tmax: config.getConfig('TTL') || 1000,
imp: [{
bidfloor: utils.deepAccess(bidRequest, 'params.floor') ? parseFloat(bidRequest.params.floor) : 0.0,
exp: 300,
id: bidRequest.adUnitCode,
secure: isSecure() || bidRequest.params.secure ? 1 : 0,
Expand All @@ -159,6 +158,10 @@ export const spec = {
}
}
}
const bidFloor = parseFloat(utils.deepAccess(bidRequest, 'params.floor'));
if (!isNaN(bidFloor)) {
data.imp[0].bidfloor = bidFloor;
}
// if value is set, will overwrite with same value
data.imp[0].ext.rubicon.video.size_id = determineRubiconVideoSizeId(bidRequest)

Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1160,15 +1160,15 @@ describe('the rubicon adapter', function () {

bidderRequest.bids[0].params.floor = 0;
[request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
expect(request.data.imp[0].bidfloor).to.equal(0.0);
expect(request.data.imp[0].bidfloor).to.equal(0);

bidderRequest.bids[0].params.floor = undefined;
[request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
expect(request.data.imp[0].bidfloor).to.equal(0.0);
expect(request.data.imp[0]).to.not.haveOwnProperty('bidfloor');

bidderRequest.bids[0].params.floor = null;
[request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
expect(request.data.imp[0].bidfloor).to.equal(0.0);
expect(request.data.imp[0]).to.not.haveOwnProperty('bidfloor');
});

it('should send request with proper ad position when mediaTypes.video.pos is not defined', function () {
Expand Down