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

Kubient Bid Adapter: update if bidfloor is zero #8008

Merged
merged 42 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ce15b44
add uspConsent to sunc URL
Nov 18, 2021
29f9866
kubient: add coppa
Dec 6, 2021
d0ddee7
added test for coppa
Dec 7, 2021
9693ce4
fix-test
Dec 7, 2021
bea4801
replace kdmp.kbntx.ch by matching.kubient.net
Dec 9, 2021
3511dcc
fix-test-and-code
Dec 9, 2021
3810334
Merge pull request #2 from kubient/kubient_ccpa
Dec 13, 2021
deed01f
Merge branch 'prebid:master' into master
alexartwww Dec 15, 2021
d6d090e
Merge branch 'prebid:master' into master
alexartwww Dec 16, 2021
3cd41f3
Merge branch 'prebid:master' into master
mapcuk Dec 20, 2021
640a702
Merge branch 'master' of github.com:prebid/Prebid.js
Dec 22, 2021
290ee97
removed URLSearchParams
Dec 29, 2021
6dcf684
early exit for getUserSyncs, updated test
Dec 29, 2021
f6b7083
test-back
Dec 29, 2021
3f24e2b
Merge branch 'prebid:master' into master
alexartwww Dec 29, 2021
9f7ce5a
Merge branch 'master' of github.com:prebid/Prebid.js
Dec 30, 2021
00f1ee1
Merge branch 'master' of github.com:kubient/Prebid.js
Dec 30, 2021
6c0ceed
test-filter-settings
Dec 30, 2021
7cdf4a4
Merge branch 'master' of github.com:kubient/Prebid.js
Dec 30, 2021
4d32180
test-filter-settings
Dec 30, 2021
68720cb
test-filter-settings
Dec 30, 2021
4fc4bf2
test-filter-settings
Dec 30, 2021
bf3d701
fix for review
Jan 10, 2022
0ed0394
fix for review
Jan 10, 2022
54cf24d
Merge branch 'master' of github.com:kubient/Prebid.js
Jan 10, 2022
eba58a0
Merge branch 'prebid:master' into master
alexartwww Jan 10, 2022
b8576d4
fix test for ci passing
Jan 12, 2022
2940f25
Merge branch 'master' of github.com:kubient/Prebid.js
Jan 12, 2022
c264d70
Merge branch 'master' of github.com:kubient/Prebid.js
Jan 12, 2022
d4aec3c
fix 2 for ci passing
Jan 12, 2022
8f8a9e8
refactored-test-for-ci
Jan 13, 2022
1c6cfdf
Merge branch 'prebid:master' into master
alexartwww Jan 13, 2022
4fe47df
Merge branch 'master' of github.com:kubient/Prebid.js
Jan 14, 2022
e684547
fix-for-review
Jan 14, 2022
e169554
fix
Jan 14, 2022
587d6e8
fix
Jan 14, 2022
f395314
Merge pull request #4 from kubient/gdpr_consent_condition2
alexartwww Jan 14, 2022
5a3685e
Merge branch 'prebid:master' into master
alexartwww Jan 14, 2022
ad67150
Merge branch 'master' of github.com:kubient/Prebid.js
Jan 24, 2022
7978d89
avoid sending zero bid floor if it is not defined
Jan 24, 2022
38b8fd7
do not send 0 bidfloor
Feb 3, 2022
63c9386
Merge branch 'master' into kubient-no-0-floor
mapcuk Feb 8, 2022
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
19 changes: 10 additions & 9 deletions modules/kubientBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,23 @@ export const spec = {
return;
}
return validBidRequests.map(function (bid) {
let floor = 0.0;
let adSlot = {
bidId: bid.bidId,
zoneId: bid.params.zoneid || ''
};

if (typeof bid.getFloor === 'function') {
const mediaType = (Object.keys(bid.mediaTypes).length == 1) ? Object.keys(bid.mediaTypes)[0] : '*';
const sizes = bid.sizes || '*';
const floorInfo = bid.getFloor({currency: 'USD', mediaType: mediaType, size: sizes});
if (typeof floorInfo === 'object' && floorInfo.currency === 'USD' && !isNaN(parseFloat(floorInfo.floor))) {
floor = parseFloat(floorInfo.floor);
if (typeof floorInfo === 'object' && floorInfo.currency === 'USD') {
let floor = parseFloat(floorInfo.floor)
if (!isNaN(floor) && floor > 0) {
adSlot.floor = parseFloat(floorInfo.floor);
}
}
}

let adSlot = {
bidId: bid.bidId,
zoneId: bid.params.zoneid || '',
floor: floor || 0.0
};

if (bid.mediaTypes.banner) {
adSlot.banner = bid.mediaTypes.banner;
}
Expand Down
8 changes: 3 additions & 5 deletions test/spec/modules/kubientBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('KubientAdapter', function () {
},
getFloor: function(params) {
return {
floor: 0.05,
floor: 0,
currency: 'USD'
};
},
Expand Down Expand Up @@ -127,10 +127,9 @@ describe('KubientAdapter', function () {
expect(data.uspConsent).to.exist.and.to.equal(uspConsentData);
for (let j = 0; j < data['adSlots'].length; j++) {
let adSlot = data['adSlots'][i];
expect(adSlot).to.have.all.keys('bidId', 'zoneId', 'floor', 'banner', 'schain');
expect(adSlot).to.have.all.keys('bidId', 'zoneId', 'banner', 'schain');
expect(adSlot.bidId).to.be.a('string').and.to.equal(bidBanner.bidId);
expect(adSlot.zoneId).to.be.a('string').and.to.equal(bidBanner.params.zoneid);
expect(adSlot.floor).to.be.a('number');
expect(adSlot.schain).to.be.an('object');
expect(adSlot.banner).to.be.an('object');
}
Expand Down Expand Up @@ -202,10 +201,9 @@ describe('KubientAdapter', function () {
expect(data.uspConsent).to.exist.and.to.equal(uspConsentData);
for (let j = 0; j < data['adSlots'].length; j++) {
let adSlot = data['adSlots'][i];
expect(adSlot).to.have.all.keys('bidId', 'zoneId', 'floor', 'banner', 'schain');
expect(adSlot).to.have.all.keys('bidId', 'zoneId', 'banner', 'schain');
expect(adSlot.bidId).to.be.a('string').and.to.equal(bidBanner.bidId);
expect(adSlot.zoneId).to.be.a('string').and.to.equal(bidBanner.params.zoneid);
expect(adSlot.floor).to.be.a('number');
expect(adSlot.schain).to.be.an('object');
expect(adSlot.banner).to.be.an('object');
}
Expand Down