From 3479745b1f2e1beb90db291273321cc7c94d4ca9 Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Fri, 12 Jul 2024 16:46:36 +0530 Subject: [PATCH 01/11] Updated docereeAdManager bid adapter --- modules/docereeAdManagerBidAdapter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/docereeAdManagerBidAdapter.js b/modules/docereeAdManagerBidAdapter.js index d3765f5a130..9e56bbe4c4d 100644 --- a/modules/docereeAdManagerBidAdapter.js +++ b/modules/docereeAdManagerBidAdapter.js @@ -74,7 +74,6 @@ function getPayload(bid, userData) { if (!userData || !bid) { return false; } - const { bidId, params } = bid; const { placementId } = params; const { @@ -95,10 +94,12 @@ function getPayload(bid, userData) { country, organization, dob, + platformUid, + mobile } = userData; const data = { - userid: userid || '', + userid: platformUid || userid || '', email: email || '', firstname: firstname || '', lastname: lastname || '', @@ -119,10 +120,11 @@ function getPayload(bid, userData) { organization: organization || '', dob: dob || '', userconsent: 1, + mobile: mobile || '' }; return { data, }; } -registerBidder(spec); +registerBidder(spec); \ No newline at end of file From ef90cd9bc0b9c76a506e00d84afb8117fbf0d261 Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Tue, 16 Jul 2024 12:27:26 +0530 Subject: [PATCH 02/11] Updated docereeAdManager bid adapter --- modules/docereeAdManagerBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docereeAdManagerBidAdapter.js b/modules/docereeAdManagerBidAdapter.js index 9e56bbe4c4d..624d826dec4 100644 --- a/modules/docereeAdManagerBidAdapter.js +++ b/modules/docereeAdManagerBidAdapter.js @@ -127,4 +127,4 @@ function getPayload(bid, userData) { }; } -registerBidder(spec); \ No newline at end of file +registerBidder(spec); From 370a6b68758f8fd4e99d22bcfc5272a730f340db Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Tue, 16 Jul 2024 13:07:10 +0530 Subject: [PATCH 03/11] Updated docereeAdManager bid adapter --- modules/docereeAdManagerBidAdapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docereeAdManagerBidAdapter.md b/modules/docereeAdManagerBidAdapter.md index bedbf57b179..4cfb5a0452d 100644 --- a/modules/docereeAdManagerBidAdapter.md +++ b/modules/docereeAdManagerBidAdapter.md @@ -6,7 +6,7 @@ Module Type: Bidder Adapter Maintainer: tech.stack@doceree.com ``` - + Connects to Doceree demand source to fetch bids. Please use `docereeadmanager` as the bidder code. From d640f5e1e389211bc0081422c01443d401e1845e Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Wed, 17 Jul 2024 11:04:20 +0530 Subject: [PATCH 04/11] Updated docereeAdManager bid adapter --- test/spec/modules/docereeAdManagerBidAdapter_spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/spec/modules/docereeAdManagerBidAdapter_spec.js b/test/spec/modules/docereeAdManagerBidAdapter_spec.js index 26b054f4e29..27e91d19f7f 100644 --- a/test/spec/modules/docereeAdManagerBidAdapter_spec.js +++ b/test/spec/modules/docereeAdManagerBidAdapter_spec.js @@ -25,6 +25,7 @@ describe('docereeadmanager', function () { userid: '', zipcode: '', userconsent: '', + platformUid : '' }, }, }, From dd7011c30c7e337157671b8be368f407f4226df9 Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Wed, 17 Jul 2024 11:13:36 +0530 Subject: [PATCH 05/11] Updated docereeAdManager bid adapter --- test/spec/modules/docereeAdManagerBidAdapter_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spec/modules/docereeAdManagerBidAdapter_spec.js b/test/spec/modules/docereeAdManagerBidAdapter_spec.js index 27e91d19f7f..e367aab9678 100644 --- a/test/spec/modules/docereeAdManagerBidAdapter_spec.js +++ b/test/spec/modules/docereeAdManagerBidAdapter_spec.js @@ -25,7 +25,7 @@ describe('docereeadmanager', function () { userid: '', zipcode: '', userconsent: '', - platformUid : '' + platformUid: '' }, }, }, From e97c816b418ab0ffa3b26eeefb5919e707c81c33 Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Wed, 17 Jul 2024 11:25:02 +0530 Subject: [PATCH 06/11] Updated docereeAdManager bid adapter --- modules/docereeAdManagerBidAdapter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docereeAdManagerBidAdapter.md b/modules/docereeAdManagerBidAdapter.md index 4cfb5a0452d..bedbf57b179 100644 --- a/modules/docereeAdManagerBidAdapter.md +++ b/modules/docereeAdManagerBidAdapter.md @@ -6,7 +6,7 @@ Module Type: Bidder Adapter Maintainer: tech.stack@doceree.com ``` - + Connects to Doceree demand source to fetch bids. Please use `docereeadmanager` as the bidder code. From 4960002980cc8a5e40b1ec3bcb5581174a2e1d56 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Fri, 19 Jul 2024 16:14:34 -0400 Subject: [PATCH 07/11] Update docereeAdManagerBidAdapter.js --- modules/docereeAdManagerBidAdapter.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/docereeAdManagerBidAdapter.js b/modules/docereeAdManagerBidAdapter.js index 624d826dec4..05310298f03 100644 --- a/modules/docereeAdManagerBidAdapter.js +++ b/modules/docereeAdManagerBidAdapter.js @@ -78,11 +78,7 @@ function getPayload(bid, userData) { const { placementId } = params; const { userid, - email, - firstname, - lastname, specialization, - hcpid, gender, city, state, @@ -93,7 +89,6 @@ function getPayload(bid, userData) { hashedmobile, country, organization, - dob, platformUid, mobile } = userData; From 71297ec2da6b03a59d8193f0ba9ed1575c6bc52b Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Tue, 23 Jul 2024 12:44:07 +0530 Subject: [PATCH 08/11] added test cases for payload formation in DocereeAdManager --- modules/docereeAdManagerBidAdapter.js | 2 +- .../docereeAdManagerBidAdapter_spec.js | 93 +++++++++++++++++-- 2 files changed, 85 insertions(+), 10 deletions(-) diff --git a/modules/docereeAdManagerBidAdapter.js b/modules/docereeAdManagerBidAdapter.js index 624d826dec4..a548ef35a12 100644 --- a/modules/docereeAdManagerBidAdapter.js +++ b/modules/docereeAdManagerBidAdapter.js @@ -70,7 +70,7 @@ export const spec = { }, }; -function getPayload(bid, userData) { +export function getPayload(bid, userData) { if (!userData || !bid) { return false; } diff --git a/test/spec/modules/docereeAdManagerBidAdapter_spec.js b/test/spec/modules/docereeAdManagerBidAdapter_spec.js index e367aab9678..16f81b8ffde 100644 --- a/test/spec/modules/docereeAdManagerBidAdapter_spec.js +++ b/test/spec/modules/docereeAdManagerBidAdapter_spec.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { spec } from '../../../modules/docereeAdManagerBidAdapter.js'; +import { spec, getPayload } from '../../../modules/docereeAdManagerBidAdapter.js'; import { config } from '../../../src/config.js'; describe('docereeadmanager', function () { @@ -7,25 +7,25 @@ describe('docereeadmanager', function () { docereeadmanager: { user: { data: { + userId: '', email: '', firstname: '', lastname: '', - mobile: '', specialization: '', - organization: '', hcpid: '', - dob: '', gender: '', city: '', state: '', - country: '', + zipcode: '', + hashedNPI: '', hashedhcpid: '', hashedemail: '', hashedmobile: '', - userid: '', - zipcode: '', - userconsent: '', - platformUid: '' + country: '', + organization: '', + dob: '', + platformUid: '', + mobile: '', }, }, }, @@ -123,4 +123,79 @@ describe('docereeadmanager', function () { .empty; }); }); + + describe('payload', function() { + it('should return payload with the correct data', function() { + const data = { + userId: 'xxxxx', + email: 'xxxx@mail.com', + firstname: 'Xxxxx', + lastname: 'Xxxxxx', + specialization: 'Xxxxxxxxx', + hcpid: 'xxxxxxx', + gender: 'Xxxx', + city: 'Xxxxx', + state: 'Xxxxxx', + zipcode: 'XXXXXX', + hashedNPI: 'xxxxxx', + hashedhcpid: 'xxxxxxx', + hashedemail: 'xxxxxxx', + hashedmobile: 'xxxxxxx', + country: 'Xxxxxx', + organization: 'Xxxxxx', + dob: 'xx-xx-xxxx', + platformUid: 'Xx.xxx.xxxxxx', + mobile: 'XXXXXXXXXX', + } + bid = {...bid, params: {...bid.params, placementId: 'DOC-19-1'}} + const payload = getPayload(bid, data); + const payloadData = payload.data; + expect(payloadData).to.have.all.keys( + 'userid', + 'email', + 'firstname', + 'lastname', + 'specialization', + 'hcpid', + 'gender', + 'city', + 'state', + 'zipcode', + 'hashedNPI', + 'pb', + 'adunit', + 'requestId', + 'hashedhcpid', + 'hashedemail', + 'hashedmobile', + 'country', + 'organization', + 'dob', + 'userconsent', + 'mobile' + ); + expect(payloadData.userid).to.equal('Xx.xxx.xxxxxx'); + expect(payloadData.email).to.equal('xxxx@mail.com'); + expect(payloadData.firstname).to.equal('Xxxxx'); + expect(payloadData.lastname).to.equal('Xxxxxx'); + expect(payloadData.specialization).to.equal('Xxxxxxxxx'); + expect(payloadData.hcpid).to.equal('xxxxxxx'); + expect(payloadData.gender).to.equal('Xxxx'); + expect(payloadData.city).to.equal('Xxxxx'); + expect(payloadData.state).to.equal('Xxxxxx'); + expect(payloadData.zipcode).to.equal('XXXXXX'); + expect(payloadData.hashedNPI).to.equal('xxxxxx'); + expect(payloadData.pb).to.equal(1); + expect(payloadData.userconsent).to.equal(1); + expect(payloadData.dob).to.equal('xx-xx-xxxx'); + expect(payloadData.organization).to.equal('Xxxxxx'); + expect(payloadData.country).to.equal('Xxxxxx'); + expect(payloadData.hashedmobile).to.equal('xxxxxxx'); + expect(payloadData.hashedemail).to.equal('xxxxxxx'); + expect(payloadData.hashedhcpid).to.equal('xxxxxxx'); + expect(payloadData.requestId).to.equal('testing'); + expect(payloadData.mobile).to.equal('XXXXXXXXXX'); + expect(payloadData.adunit).to.equal('DOC-19-1'); + }) + }) }); From 43799bcbf155e481d496e67a6e2292cdbe55bdc6 Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Fri, 2 Aug 2024 12:58:54 +0530 Subject: [PATCH 09/11] Added support for publisherUrl --- modules/docereeAdManagerBidAdapter.js | 10 ++++++++-- test/spec/modules/docereeAdManagerBidAdapter_spec.js | 5 ++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/docereeAdManagerBidAdapter.js b/modules/docereeAdManagerBidAdapter.js index dc5802aad2e..d115e785969 100644 --- a/modules/docereeAdManagerBidAdapter.js +++ b/modules/docereeAdManagerBidAdapter.js @@ -75,9 +75,14 @@ export function getPayload(bid, userData) { return false; } const { bidId, params } = bid; - const { placementId } = params; + const { placementId, publisherUrl } = params; const { userid, + email, + firstname, + lastname, + hcpid, + dob, specialization, gender, city, @@ -115,7 +120,8 @@ export function getPayload(bid, userData) { organization: organization || '', dob: dob || '', userconsent: 1, - mobile: mobile || '' + mobile: mobile || '', + pageurl: publisherUrl || '' }; return { data, diff --git a/test/spec/modules/docereeAdManagerBidAdapter_spec.js b/test/spec/modules/docereeAdManagerBidAdapter_spec.js index 16f81b8ffde..b231d5572bf 100644 --- a/test/spec/modules/docereeAdManagerBidAdapter_spec.js +++ b/test/spec/modules/docereeAdManagerBidAdapter_spec.js @@ -35,6 +35,7 @@ describe('docereeadmanager', function () { bidder: 'docereeadmanager', params: { placementId: 'DOC-19-1', + publisherUrl: 'xxxxxx.com/xxxx', gdpr: '1', gdprconsent: 'CPQfU1jPQfU1jG0AAAENAwCAAAAAAAAAAAAAAAAAAAAA.IGLtV_T9fb2vj-_Z99_tkeYwf95y3p-wzhheMs-8NyZeH_B4Wv2MyvBX4JiQKGRgksjLBAQdtHGlcTQgBwIlViTLMYk2MjzNKJrJEilsbO2dYGD9Pn8HT3ZCY70-vv__7v3ff_3g', @@ -172,7 +173,8 @@ describe('docereeadmanager', function () { 'organization', 'dob', 'userconsent', - 'mobile' + 'mobile', + 'pageurl' ); expect(payloadData.userid).to.equal('Xx.xxx.xxxxxx'); expect(payloadData.email).to.equal('xxxx@mail.com'); @@ -196,6 +198,7 @@ describe('docereeadmanager', function () { expect(payloadData.requestId).to.equal('testing'); expect(payloadData.mobile).to.equal('XXXXXXXXXX'); expect(payloadData.adunit).to.equal('DOC-19-1'); + expect(payloadData.pageurl).to.equal('xxxxxx.com/xxxx'); }) }) }); From 456f1c320405baf432c452a54051a28f2f81984f Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Mon, 5 Aug 2024 17:06:37 +0530 Subject: [PATCH 10/11] added some parameters --- modules/docereeAdManagerBidAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/docereeAdManagerBidAdapter.js b/modules/docereeAdManagerBidAdapter.js index a5e5a884114..d115e785969 100644 --- a/modules/docereeAdManagerBidAdapter.js +++ b/modules/docereeAdManagerBidAdapter.js @@ -104,7 +104,7 @@ export function getPayload(bid, userData) { firstname: firstname || '', lastname: lastname || '', specialization: specialization || '', - hcpid: '', + hcpid: hcpid || '', gender: gender || '', city: city || '', state: state || '', @@ -118,7 +118,7 @@ export function getPayload(bid, userData) { hashedmobile: hashedmobile || '', country: country || '', organization: organization || '', - dob: '', + dob: dob || '', userconsent: 1, mobile: mobile || '', pageurl: publisherUrl || '' From 3d3a84fcd0048bbd33c69feb8a3783ad823020dc Mon Sep 17 00:00:00 2001 From: lokesh-doceree Date: Wed, 11 Sep 2024 18:07:20 +0530 Subject: [PATCH 11/11] Added support for TCF 2.2 --- modules/docereeAdManagerBidAdapter.js | 19 ++++++++++++++++--- .../docereeAdManagerBidAdapter_spec.js | 13 +++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/modules/docereeAdManagerBidAdapter.js b/modules/docereeAdManagerBidAdapter.js index d115e785969..d7a28d6b788 100644 --- a/modules/docereeAdManagerBidAdapter.js +++ b/modules/docereeAdManagerBidAdapter.js @@ -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; @@ -70,7 +70,7 @@ export const spec = { }, }; -export function getPayload(bid, userData) { +export function getPayload(bid, userData, bidderRequest) { if (!userData || !bid) { return false; } @@ -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, }; diff --git a/test/spec/modules/docereeAdManagerBidAdapter_spec.js b/test/spec/modules/docereeAdManagerBidAdapter_spec.js index b231d5572bf..268e30f542d 100644 --- a/test/spec/modules/docereeAdManagerBidAdapter_spec.js +++ b/test/spec/modules/docereeAdManagerBidAdapter_spec.js @@ -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', @@ -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('xxxx@mail.com'); @@ -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); }) }) });