Skip to content

Commit b09f9f0

Browse files
authoredJul 11, 2022
ADOT Bid Adapter: handle schain & pubProvidedId (prebid#8670)
* [DSP-3689] feature: add pubProvidedId to user (#6) [DSP-3689] feature: add pubProvidedId to user * [DSP-3690] feature: Handle schain object (#7)
1 parent cae46d6 commit b09f9f0

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed
 

‎modules/adotBidAdapter.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ function getOpenRTBSiteObject(bidderRequest) {
6262
name: domain,
6363
publisher: {
6464
id: publisherId
65+
},
66+
ext: {
67+
schain: bidderRequest.schain
6568
}
6669
};
6770
}
@@ -83,7 +86,13 @@ function getOpenRTBDeviceObject() {
8386
*/
8487
function getOpenRTBUserObject(bidderRequest) {
8588
if (!bidderRequest || !bidderRequest.gdprConsent || !isStr(bidderRequest.gdprConsent.consentString)) return null;
86-
return { ext: { consent: bidderRequest.gdprConsent.consentString } };
89+
90+
return {
91+
ext: {
92+
consent: bidderRequest.gdprConsent.consentString,
93+
pubProvidedId: bidderRequest.userId && bidderRequest.userId.pubProvidedId,
94+
},
95+
};
8796
}
8897

8998
/**

‎test/spec/modules/adotBidAdapter_spec.js

+12-9
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Adot Adapter', function () {
2828
it('should build request (banner)', function () {
2929
const bidderRequestId = 'bidderRequestId';
3030
const validBidRequests = [{ bidderRequestId, mediaTypes: {} }, { bidderRequestId, bidId: 'bidId', mediaTypes: { banner: { sizes: [[300, 250]] } }, params: { placementId: 'placementId', adUnitCode: 200 } }];
31-
const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true } };
31+
const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true }, userId: { pubProvidedId: 'userId' }, schain: { ver: '1.0' } };
3232

3333
const request = spec.buildRequests(validBidRequests, bidderRequest);
3434
const buildBidRequestResponse = {
@@ -54,10 +54,11 @@ describe('Adot Adapter', function () {
5454
publisher: {
5555
// id: 'adot'
5656
id: undefined
57-
}
57+
},
58+
ext: { schain: { ver: '1.0' } }
5859
},
5960
device: { ua: navigator.userAgent, language: navigator.language },
60-
user: { ext: { consent: bidderRequest.gdprConsent.consentString } },
61+
user: { ext: { consent: bidderRequest.gdprConsent.consentString, pubProvidedId: 'userId' } },
6162
regs: { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies } },
6263
ext: {
6364
adot: { adapter_version: 'v2.0.0' },
@@ -76,7 +77,7 @@ describe('Adot Adapter', function () {
7677
it('should build request (native)', function () {
7778
const bidderRequestId = 'bidderRequestId';
7879
const validBidRequests = [{ bidderRequestId, mediaTypes: {} }, { bidderRequestId, bidId: 'bidId', mediaTypes: { native: { title: { required: true, len: 50, sizes: [[300, 250]] }, wrong: {}, image: {} } }, params: { placementId: 'placementId', adUnitCode: 200 } }];
79-
const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true } };
80+
const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true }, userId: { pubProvidedId: 'userId' }, schain: { ver: '1.0' } };
8081

8182
const request = spec.buildRequests(validBidRequests, bidderRequest);
8283
const buildBidRequestResponse = {
@@ -101,10 +102,11 @@ describe('Adot Adapter', function () {
101102
publisher: {
102103
// id: 'adot'
103104
id: undefined
104-
}
105+
},
106+
ext: { schain: { ver: '1.0' } }
105107
},
106108
device: { ua: navigator.userAgent, language: navigator.language },
107-
user: { ext: { consent: bidderRequest.gdprConsent.consentString } },
109+
user: { ext: { consent: bidderRequest.gdprConsent.consentString, pubProvidedId: 'userId' } },
108110
regs: { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies } },
109111
ext: {
110112
adot: { adapter_version: 'v2.0.0' },
@@ -123,7 +125,7 @@ describe('Adot Adapter', function () {
123125
it('should build request (video)', function () {
124126
const bidderRequestId = 'bidderRequestId';
125127
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 } }];
126-
const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true } };
128+
const bidderRequest = { position: 2, refererInfo: { page: 'http://localhost.com', domain: 'localhost.com' }, gdprConsent: { consentString: 'consentString', gdprApplies: true }, userId: { pubProvidedId: 'userId' }, schain: { ver: '1.0' } };
127129

128130
const request = spec.buildRequests(validBidRequests, bidderRequest);
129131
const buildBidRequestResponse = {
@@ -160,10 +162,11 @@ describe('Adot Adapter', function () {
160162
publisher: {
161163
// id: 'adot'
162164
id: undefined
163-
}
165+
},
166+
ext: { schain: { ver: '1.0' } }
164167
},
165168
device: { ua: navigator.userAgent, language: navigator.language },
166-
user: { ext: { consent: bidderRequest.gdprConsent.consentString } },
169+
user: { ext: { consent: bidderRequest.gdprConsent.consentString, pubProvidedId: 'userId' } },
167170
regs: { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies } },
168171
ext: {
169172
adot: { adapter_version: 'v2.0.0' },

0 commit comments

Comments
 (0)
Failed to load comments.