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

Doceree AdManager Bid Adapter : added support for TCF 2.2 #12226

Merged
merged 21 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3479745
Updated docereeAdManager bid adapter
lokesh-doceree Jul 12, 2024
ef90cd9
Updated docereeAdManager bid adapter
lokesh-doceree Jul 16, 2024
54c51cf
Merge branch 'prebid:master' into master
Doceree-techStack Jul 16, 2024
370a6b6
Updated docereeAdManager bid adapter
lokesh-doceree Jul 16, 2024
a2877d2
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Jul 16, 2024
d640f5e
Updated docereeAdManager bid adapter
lokesh-doceree Jul 17, 2024
616cf80
Merge branch 'prebid:master' into master
Doceree-techStack Jul 17, 2024
dd7011c
Updated docereeAdManager bid adapter
lokesh-doceree Jul 17, 2024
0e7c161
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Jul 17, 2024
e97c816
Updated docereeAdManager bid adapter
lokesh-doceree Jul 17, 2024
4960002
Update docereeAdManagerBidAdapter.js
patmmccann Jul 19, 2024
71297ec
added test cases for payload formation in DocereeAdManager
lokesh-doceree Jul 23, 2024
72dbdfd
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Jul 23, 2024
43799bc
Added support for publisherUrl
lokesh-doceree Aug 2, 2024
660e80e
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Aug 2, 2024
456f1c3
added some parameters
lokesh-doceree Aug 5, 2024
629439e
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Aug 5, 2024
f89f4e8
Merge branch 'prebid:master' into master
Doceree-techStack Sep 3, 2024
3d3a84f
Added support for TCF 2.2
lokesh-doceree Sep 11, 2024
8870881
Merge branch 'master' of https://github.com/Doceree-techStack/Prebid.js
lokesh-doceree Sep 11, 2024
b99ae6f
Merge branch 'prebid:master' into master
Doceree-techStack Sep 11, 2024
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: 16 additions & 3 deletions modules/docereeAdManagerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export const spec = {
}
return true;
},
buildRequests: (validBidRequests) => {
buildRequests: (validBidRequests, bidderRequest) => {
const serverRequests = [];
const { data } = config.getConfig('docereeadmanager.user') || {};

validBidRequests.forEach(function (validBidRequest) {
const payload = getPayload(validBidRequest, data);
const payload = getPayload(validBidRequest, data, bidderRequest);

if (!payload) {
return;
Expand Down Expand Up @@ -70,7 +70,7 @@ export const spec = {
},
};

export function getPayload(bid, userData) {
export function getPayload(bid, userData, bidderRequest) {
if (!userData || !bid) {
return false;
}
Expand Down Expand Up @@ -123,6 +123,19 @@ export function getPayload(bid, userData) {
mobile: mobile || '',
pageurl: publisherUrl || ''
};

try {
if (bidderRequest && bidderRequest.gdprConsent) {
const { gdprApplies, consentString } = bidderRequest.gdprConsent;
data['consent'] = {
'gdpr': gdprApplies ? 1 : 0,
'gdprstr': consentString || '',
}
}
} catch (error) {

}

return {
data,
};
Expand Down
13 changes: 11 additions & 2 deletions test/spec/modules/docereeAdManagerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@ describe('docereeadmanager', function () {
mobile: 'XXXXXXXXXX',
}
bid = {...bid, params: {...bid.params, placementId: 'DOC-19-1'}}
const payload = getPayload(bid, data);
const buildRequests = {
gdprConsent: {
consentString: 'COwK6gaOwK6gaFmAAAENAPCAAAAAAAAAAAAAAAAAAAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
gdprApplies: false
}
}
const payload = getPayload(bid, data, buildRequests);
const payloadData = payload.data;
expect(payloadData).to.have.all.keys(
'userid',
Expand All @@ -174,7 +180,8 @@ describe('docereeadmanager', function () {
'dob',
'userconsent',
'mobile',
'pageurl'
'pageurl',
'consent'
);
expect(payloadData.userid).to.equal('Xx.xxx.xxxxxx');
expect(payloadData.email).to.equal('[email protected]');
Expand All @@ -199,6 +206,8 @@ describe('docereeadmanager', function () {
expect(payloadData.mobile).to.equal('XXXXXXXXXX');
expect(payloadData.adunit).to.equal('DOC-19-1');
expect(payloadData.pageurl).to.equal('xxxxxx.com/xxxx');
expect(payloadData.consent.gdprstr).to.equal('COwK6gaOwK6gaFmAAAENAPCAAAAAAAAAAAAAAAAAAAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw');
expect(payloadData.consent.gdpr).to.equal(0);
})
})
});