From 3395e659daa4661b3885f6a07e688f40706318df Mon Sep 17 00:00:00 2001 From: Alexandre K/ourio Date: Thu, 7 Jul 2022 11:27:45 +0200 Subject: [PATCH 1/2] [DSP-3689] feature: add pubProvidedId to user --- modules/adotBidAdapter.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/adotBidAdapter.js b/modules/adotBidAdapter.js index 869cd69a830..c8dcb7b708f 100644 --- a/modules/adotBidAdapter.js +++ b/modules/adotBidAdapter.js @@ -83,7 +83,13 @@ function getOpenRTBDeviceObject() { */ function getOpenRTBUserObject(bidderRequest) { if (!bidderRequest || !bidderRequest.gdprConsent || !isStr(bidderRequest.gdprConsent.consentString)) return null; - return { ext: { consent: bidderRequest.gdprConsent.consentString } }; + + return { + ext: { + consent: bidderRequest.gdprConsent.consentString, + pubProvidedId: bidderRequest.userId && bidderRequest.userId.pubProvidedId, + }, + }; } /** From c30d4bbb5ea170dbab3575b5b59614b32fba7259 Mon Sep 17 00:00:00 2001 From: Alexandre K/ourio Date: Thu, 7 Jul 2022 16:45:08 +0200 Subject: [PATCH 2/2] add tests --- test/spec/modules/adotBidAdapter_spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/spec/modules/adotBidAdapter_spec.js b/test/spec/modules/adotBidAdapter_spec.js index 8851df37d34..d5fc098d005 100644 --- a/test/spec/modules/adotBidAdapter_spec.js +++ b/test/spec/modules/adotBidAdapter_spec.js @@ -28,7 +28,7 @@ describe('Adot Adapter', function () { it('should build request (banner)', function () { const bidderRequestId = 'bidderRequestId'; const validBidRequests = [{ bidderRequestId, mediaTypes: {} }, { bidderRequestId, bidId: 'bidId', mediaTypes: { banner: { sizes: [[300, 250]] } }, params: { placementId: 'placementId', adUnitCode: 200 } }]; - const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true } }; + const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true }, userId: { pubProvidedId: 'userId' } }; const request = spec.buildRequests(validBidRequests, bidderRequest); const buildBidRequestResponse = { @@ -57,7 +57,7 @@ describe('Adot Adapter', function () { } }, device: { ua: navigator.userAgent, language: navigator.language }, - user: { ext: { consent: bidderRequest.gdprConsent.consentString } }, + user: { ext: { consent: bidderRequest.gdprConsent.consentString, pubProvidedId: 'userId' } }, regs: { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies } }, ext: { adot: { adapter_version: 'v2.0.0' }, @@ -76,7 +76,7 @@ describe('Adot Adapter', function () { it('should build request (native)', function () { const bidderRequestId = 'bidderRequestId'; const validBidRequests = [{ bidderRequestId, mediaTypes: {} }, { bidderRequestId, bidId: 'bidId', mediaTypes: { native: { title: { required: true, len: 50, sizes: [[300, 250]] }, wrong: {}, image: {} } }, params: { placementId: 'placementId', adUnitCode: 200 } }]; - const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true } }; + const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true }, userId: { pubProvidedId: 'userId' } }; const request = spec.buildRequests(validBidRequests, bidderRequest); const buildBidRequestResponse = { @@ -104,7 +104,7 @@ describe('Adot Adapter', function () { } }, device: { ua: navigator.userAgent, language: navigator.language }, - user: { ext: { consent: bidderRequest.gdprConsent.consentString } }, + user: { ext: { consent: bidderRequest.gdprConsent.consentString, pubProvidedId: 'userId' } }, regs: { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies } }, ext: { adot: { adapter_version: 'v2.0.0' }, @@ -123,7 +123,7 @@ describe('Adot Adapter', function () { it('should build request (video)', function () { const bidderRequestId = 'bidderRequestId'; const validBidRequests = [{ bidderRequestId, mediaTypes: {} }, { bidderRequestId, bidId: 'bidId', mediaTypes: { video: { playerSize: [[300, 250]], minduration: 1, maxduration: 2, api: 'api', linearity: 'linearity', mimes: [], placement: 'placement', playbackmethod: 'playbackmethod', protocols: 'protocol', startdelay: 'startdelay' } }, params: { placementId: 'placementId', adUnitCode: 200 } }]; - const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true } }; + const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true }, userId: { pubProvidedId: 'userId' } }; const request = spec.buildRequests(validBidRequests, bidderRequest); const buildBidRequestResponse = { @@ -163,7 +163,7 @@ describe('Adot Adapter', function () { } }, device: { ua: navigator.userAgent, language: navigator.language }, - user: { ext: { consent: bidderRequest.gdprConsent.consentString } }, + user: { ext: { consent: bidderRequest.gdprConsent.consentString, pubProvidedId: 'userId' } }, regs: { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies } }, ext: { adot: { adapter_version: 'v2.0.0' },