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

Undertone Bid Adapter : added GPP and video placements #10016

Merged
merged 31 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d8779ee
* Update undertone adapter - change parameters - placementId paramete…
omerko May 30, 2018
6785395
* Update undertone adapter - change parameters - placementId paramete…
omerko May 30, 2018
c5611e3
fix lint issue in undertone adapter spec
omerko May 30, 2018
eea398e
Merge branch 'master' of https://github.com/prebid/Prebid.js
omerko Jul 15, 2018
ddcce01
added user sync function to undertone adapter
omerko Sep 13, 2018
2d5bd83
* Update undertone adapter - change parameters - placementId paramete…
omerko May 30, 2018
a33df49
added user sync function to undertone adapter
omerko Sep 13, 2018
467a238
added user sync function to undertone adapter
omerko Sep 16, 2018
4f3342c
Merge remote-tracking branch 'origin/master'
omerko Sep 16, 2018
95228a2
revert package-lock.json
omerko Oct 11, 2018
852cd6d
Merge branch 'master' of https://github.com/prebid/Prebid.js
AnnaPerion Mar 8, 2020
55fad56
added user sync function to undertone adapter
omerko Sep 13, 2018
33bf123
Merge branch 'master' of https://github.com/PerionNet/Prebid.js
AnnaPerion Mar 25, 2020
beba2be
Update undertoneBidAdapter.js
AnnaPerion Mar 25, 2020
bf43be9
Merge branch 'master' of https://github.com/prebid/Prebid.js
AnnaPerion Jun 28, 2020
2f99051
Merge remote-tracking branch 'upstream/master'
AnnaPerion Jul 12, 2020
b9d2b8f
Merge branch 'prebid:master' into master
oranperion Jun 3, 2021
c5be0d7
Update browsers.json
tamirnPerion Aug 17, 2021
3490951
Merge branch 'prebid:master' into master
tamirnPerion Oct 31, 2021
9e97cba
Merge branch 'master' of https://github.com/PerionNet/Prebid.js
tamarm-perion Nov 10, 2021
d081f73
Merge branch 'prebid:master' into master
tamarm-perion Jun 27, 2022
f3254c6
Merge branch 'prebid:master' into master
tamarm-perion Jun 30, 2022
84a2a98
Merge branch 'prebid:master' into master
tamarm-perion Nov 17, 2022
51297c3
Merge remote-tracking branch 'upstream/master'
idanbotbol May 29, 2023
b18441e
Undertone: added GPP support and video plcmt
idanbotbol May 29, 2023
4408d7f
Merge branch 'prebid:master' into master
idanbotbol May 29, 2023
91818eb
Merge pull request #37 from PerionNet/UN-38024
idanbotbol May 29, 2023
60a1be2
Merge branch 'prebid:master' into master
idanbotbol May 31, 2023
36bdc56
Fix lint issues
idanbotbol Jun 1, 2023
4c70b42
Merge pull request #38 from PerionNet/UN-38164
idanbotbol Jun 1, 2023
49bdacf
Merge branch 'prebid:master' into master
idanbotbol Jun 1, 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
10 changes: 9 additions & 1 deletion modules/undertoneBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ export const spec = {
reqUrl += `&ccpa=${bidderRequest.uspConsent}`;
}

if (bidderRequest.gppConsent) {
const gppString = bidderRequest.gppConsent.gppString ?? '';
const ggpSid = bidderRequest.gppConsent.applicableSections ?? '';
reqUrl += `&gpp=${gppString}&gpp_sid=${ggpSid}`;
}

validBidRequests.map(bidReq => {
const bid = {
bidRequestId: bidReq.bidId,
Expand All @@ -146,7 +152,9 @@ export const spec = {
streamType: deepAccess(bidReq, 'mediaTypes.video.context') || null,
playbackMethod: deepAccess(bidReq, 'params.video.playbackMethod') || null,
maxDuration: deepAccess(bidReq, 'params.video.maxDuration') || null,
skippable: deepAccess(bidReq, 'params.video.skippable') || null
skippable: deepAccess(bidReq, 'params.video.skippable') || null,
placement: deepAccess(bidReq, 'mediaTypes.video.placement') || null,
plcmt: deepAccess(bidReq, 'mediaTypes.video.plcmt') || null
};
}
payload['x-ut-hb-params'].push(bid);
Expand Down
58 changes: 57 additions & 1 deletion test/spec/modules/undertoneBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ const videoBidReq = [{
},
mediaTypes: {video: {
context: 'outstream',
playerSize: [640, 480]
playerSize: [640, 480],
placement: 1,
plcmt: 1
}},
sizes: [[300, 250], [300, 600]],
bidId: '263be71e91dd9d',
Expand Down Expand Up @@ -184,6 +186,31 @@ const bidderReqCcpaAndGdpr = {
uspConsent: 'NY12'
};

const bidderReqGpp = {
refererInfo: {
topmostLocation: 'http://prebid.org/dev-docs/bidder-adaptor.html'
},
gppConsent: {
gppString: 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN',
applicableSections: [7]
}
};

const bidderReqFullGppCcpaGdpr = {
refererInfo: {
topmostLocation: 'http://prebid.org/dev-docs/bidder-adaptor.html'
},
gppConsent: {
gppString: 'DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN',
applicableSections: [7]
},
gdprConsent: {
gdprApplies: true,
consentString: 'gdprConsent'
},
uspConsent: '1YNN'
};

const validBidRes = {
ad: '<div>Hello</div>',
publisherId: 12345,
Expand Down Expand Up @@ -381,6 +408,31 @@ describe('Undertone Adapter', () => {
expect(request.url).to.equal(REQ_URL);
expect(request.method).to.equal('POST');
});
it(`should have gppConsent fields`, function () {
const request = spec.buildRequests(bidReq, bidderReqGpp);
const domainStart = bidderReq.refererInfo.topmostLocation.indexOf('//');
const domainEnd = bidderReq.refererInfo.topmostLocation.indexOf('/', domainStart + 2);
const domain = bidderReq.refererInfo.topmostLocation.substring(domainStart + 2, domainEnd);
const gppStr = bidderReqGpp.gppConsent.gppString;
const gppSid = bidderReqGpp.gppConsent.applicableSections;
const REQ_URL = `${URL}?pid=${bidReq[0].params.publisherId}&domain=${domain}&gpp=${gppStr}&gpp_sid=${gppSid}`;
expect(request.url).to.equal(REQ_URL);
expect(request.method).to.equal('POST');
});
it(`should have gpp, ccpa and gdpr fields`, function () {
const request = spec.buildRequests(bidReq, bidderReqFullGppCcpaGdpr);
const domainStart = bidderReq.refererInfo.topmostLocation.indexOf('//');
const domainEnd = bidderReq.refererInfo.topmostLocation.indexOf('/', domainStart + 2);
const domain = bidderReq.refererInfo.topmostLocation.substring(domainStart + 2, domainEnd);
const gppStr = bidderReqFullGppCcpaGdpr.gppConsent.gppString;
const gppSid = bidderReqFullGppCcpaGdpr.gppConsent.applicableSections;
const ccpa = bidderReqFullGppCcpaGdpr.uspConsent;
const gdpr = bidderReqFullGppCcpaGdpr.gdprConsent.gdprApplies ? 1 : 0;
const gdprStr = bidderReqFullGppCcpaGdpr.gdprConsent.consentString;
const REQ_URL = `${URL}?pid=${bidReq[0].params.publisherId}&domain=${domain}&gdpr=${gdpr}&gdprstr=${gdprStr}&ccpa=${ccpa}&gpp=${gppStr}&gpp_sid=${gppSid}`;
expect(request.url).to.equal(REQ_URL);
expect(request.method).to.equal('POST');
});
it('should have all relevant fields', function () {
const request = spec.buildRequests(bidReq, bidderReq);
const bid1 = JSON.parse(request.data)['x-ut-hb-params'][0];
Expand Down Expand Up @@ -409,10 +461,14 @@ describe('Undertone Adapter', () => {
expect(bidVideo.video.playbackMethod).to.equal(2);
expect(bidVideo.video.maxDuration).to.equal(30);
expect(bidVideo.video.skippable).to.equal(true);
expect(bidVideo.video.placement).to.equal(1);
expect(bidVideo.video.plcmt).to.equal(1);

expect(bidVideo2.video.skippable).to.equal(null);
expect(bidVideo2.video.maxDuration).to.equal(null);
expect(bidVideo2.video.playbackMethod).to.equal(null);
expect(bidVideo2.video.placement).to.equal(null);
expect(bidVideo2.video.plcmt).to.equal(null);
});
it('should send all userIds data to server', function () {
const request = spec.buildRequests(bidReqUserIds, bidderReq);
Expand Down