diff --git a/modules/undertoneBidAdapter.js b/modules/undertoneBidAdapter.js
index 28893d04b3f..9dcbefd374b 100644
--- a/modules/undertoneBidAdapter.js
+++ b/modules/undertoneBidAdapter.js
@@ -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,
@@ -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);
diff --git a/test/spec/modules/undertoneBidAdapter_spec.js b/test/spec/modules/undertoneBidAdapter_spec.js
index 8766307b3bd..7f9c2e7b3d5 100644
--- a/test/spec/modules/undertoneBidAdapter_spec.js
+++ b/test/spec/modules/undertoneBidAdapter_spec.js
@@ -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',
@@ -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: '
Hello
',
publisherId: 12345,
@@ -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];
@@ -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);