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

pubGENIUS bid adapter: support floor module #6555

Merged
merged 1 commit into from
Apr 12, 2021
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
15 changes: 11 additions & 4 deletions modules/pubgeniusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
deepSetValue,
inIframe,
isArrayOfNums,
isFn,
isInteger,
isNumber,
isStr,
logError,
parseQueryStringParameters,
Expand Down Expand Up @@ -185,9 +185,16 @@ function buildImp(bid) {
imp.video = buildVideoParams(bid.mediaTypes.video, bid.params.video);
}

const bidFloor = bid.params.bidFloor;
if (isNumber(bidFloor)) {
imp.bidfloor = bidFloor;
if (isFn(bid.getFloor)) {
const { floor } = bid.getFloor({
mediaType: bid.mediaTypes.banner ? 'banner' : 'video',
size: '*',
currency: 'USD',
});

if (floor) {
imp.bidfloor = floor;
}
}

const pos = bid.params.position;
Expand Down
4 changes: 0 additions & 4 deletions modules/pubgeniusBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ Module that connects to pubGENIUS's demand sources

# Test Parameters

Test bids have $0.01 CPM by default. Use `bidFloor` in bidder params to control CPM for testing purposes.

```
var adUnits = [
{
Expand Down Expand Up @@ -45,7 +43,6 @@ var adUnits = [
bidder: 'pubgenius',
params: {
adUnitId: '1000',
bidFloor: 0.5,
test: true
}
}
Expand All @@ -66,7 +63,6 @@ var adUnits = [
bidder: 'pubgenius',
params: {
adUnitId: '1001',
bidFloor: 1,
test: true,

// other video parameters as in OpenRTB v2.5 spec
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/pubgeniusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ describe('pubGENIUS adapter', () => {
expect(buildRequests([bidRequest, bidRequest1], bidderRequest)).to.deep.equal(expectedRequest);
});

it('should take bid floor in bidder params', () => {
bidRequest.params.bidFloor = 0.5;
it('should take bid floor from getFloor interface', () => {
bidRequest.getFloor = () => ({ floor: 0.5, currency: 'USD' });
expectedRequest.data.imp[0].bidfloor = 0.5;

expect(buildRequests([bidRequest], bidderRequest)).to.deep.equal(expectedRequest);
Expand Down