Skip to content

NoBid Bid Adapter: support for Floors #9635

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

Merged
merged 24 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0eba11e
Enable supplyChain support
redaguermas Mar 4, 2020
c0fb8ee
Added support for COPPA
redaguermas Mar 5, 2020
36fab76
Merge branch 'master' of https://github.com/prebid/Prebid.js
redaguermas Mar 13, 2020
51525d7
Merge branch 'master' of https://github.com/prebid/Prebid.js
redaguermas Apr 13, 2020
c473780
Merge remote-tracking branch 'upstream/master'
Jun 1, 2020
33757b8
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jun 4, 2020
9e1758b
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jun 19, 2020
1d7db5d
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 18, 2020
8fca715
Merge branch 'master' of https://github.com/prebid/Prebid.js
Aug 26, 2020
c11a5b3
rebuilt
Sep 27, 2020
c44bd3f
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 27, 2020
9c8440c
Added support for Extended User IDs.
Sep 28, 2020
ec5cde7
Merge branch 'master' of https://github.com/prebid/Prebid.js
May 28, 2021
ff10bbe
Added support for the "meta" attribute in bid response.
May 28, 2021
4a4c253
Merge branch 'master' of https://github.com/prebid/Prebid.js
Jul 13, 2021
01a2d94
Merge branch 'master' of https://github.com/prebid/Prebid.js
Sep 27, 2021
61583a2
Merge branch 'master' of https://github.com/prebid/Prebid.js
Mar 7, 2023
fe57afa
Added support for Floors to the NoBid Prebid Adapter.
Mar 8, 2023
94bcd99
Delete .project
redaguermas Mar 8, 2023
90d1626
Delete .jsdtscope
redaguermas Mar 8, 2023
9b77080
Delete org.eclipse.wst.jsdt.ui.superType.container
redaguermas Mar 8, 2023
ad3d2af
Delete org.eclipse.wst.jsdt.ui.superType.name
redaguermas Mar 8, 2023
6564eef
Delete a
redaguermas Mar 8, 2023
ea67e40
Delete nobidBidAdapter.js.orig
redaguermas Mar 8, 2023
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: 13 additions & 2 deletions modules/nobidBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {hasPurpose1Consent} from '../src/utils/gpdr.js';
const GVLID = 816;
const BIDDER_CODE = 'nobid';
const storage = getStorageManager({gvlid: GVLID, bidderCode: BIDDER_CODE});
window.nobidVersion = '1.3.2';
window.nobidVersion = '1.3.3';
window.nobid = window.nobid || {};
window.nobid.bidResponses = window.nobid.bidResponses || {};
window.nobid.timeoutTotal = 0;
Expand Down Expand Up @@ -175,6 +175,9 @@ function nobidBuildRequests(bids, bidderRequest) {
if (adunitObject.div) {
a.d = adunitObject.div;
}
if (adunitObject.floor) {
a.floor = adunitObject.floor;
}
if (adunitObject.targeting) {
a.g = adunitObject.targeting;
} else {
Expand All @@ -201,6 +204,12 @@ function nobidBuildRequests(bids, bidderRequest) {
adunits.push(a);
return adunits;
}
function getFloor (bid) {
if (bid && typeof bid.getFloor === 'function' && bid.getFloor().floor) {
return bid.getFloor().floor;
}
return null;
}
if (typeof window.nobid.refreshLimit !== 'undefined') {
if (window.nobid.refreshLimit < window.nobid.refreshCount) return false;
}
Expand All @@ -227,6 +236,7 @@ function nobidBuildRequests(bids, bidderRequest) {
if (bid.mediaType === VIDEO || (videoMediaType && (context === 'instream' || context === 'outstream'))) {
adType = 'video';
}
const floor = getFloor(bid);

if (siteId) {
newAdunit({
Expand All @@ -235,7 +245,8 @@ function nobidBuildRequests(bids, bidderRequest) {
siteId: siteId,
placementId: placementId,
ad_type: adType,
params: bid.params
params: bid.params,
floor: floor
},
adunits);
}
Expand Down
4 changes: 2 additions & 2 deletions modules/nobidBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Nobid
description: Prebid Nobid Bidder Adaptor
biddercode: nobid
hide: true
media_types: banner
media_types: banner, video
gdpr_supported: true
usp_supported: true
---
Expand Down Expand Up @@ -51,4 +51,4 @@ usp_supported: true
]
}
];
```
```
32 changes: 32 additions & 0 deletions test/spec/modules/nobidBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,38 @@ describe('Nobid Adapter', function () {
});
});

describe('buildRequestsWithFloor', function () {
const SITE_ID = 2;
const REFERER = 'https://www.examplereferer.com';
let bidRequests = [
{
'bidder': 'nobid',
'params': {
'siteId': SITE_ID
},
'getFloor': () => { return { currency: 'USD', floor: 1.00 } },
'adUnitCode': 'adunit-code',
'sizes': [[300, 250]],
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
'auctionId': '1d1a030790a475'
}
];

let bidderRequest = {
refererInfo: {page: REFERER}
}

it('should FLoor = 1', function () {
spec.buildRequests(bidRequests, bidderRequest);
const request = spec.buildRequests(bidRequests, bidderRequest);
/* eslint-disable no-console */
console.log('request.data:', request.data);
const payload = JSON.parse(request.data);
expect(payload.a[0].floor).to.equal(1);
});
});

describe('isBidRequestValid', function () {
let bid = {
'bidder': 'nobid',
Expand Down