From e058fee7bb0ecd4e95457ea19b4b392ad7f7a0d7 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Wed, 20 Jan 2021 11:22:39 +0530 Subject: [PATCH 01/23] initial commit --- modules/deepintentDpesSystem.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 modules/deepintentDpesSystem.js diff --git a/modules/deepintentDpesSystem.js b/modules/deepintentDpesSystem.js new file mode 100644 index 00000000000..047514a71d0 --- /dev/null +++ b/modules/deepintentDpesSystem.js @@ -0,0 +1,18 @@ +/** + * This module adds DPES to the User ID module + * The {@link module:modules/userId} module is required + * @module modules/deepintentDpesSubmodule + * @requires module:modules/userId + */ + + +import * as utils from '../src/utils.js' +import { ajax } from '../src/ajax.js'; +import { submodule } from '../src/hook.js'; + +/** @type {Submodule} */ +export const deepintentDpesSubmodule = { + +} + +submodule('userId',deepintentDpesSubmodule); \ No newline at end of file From ef641aae5e4e8707a0ab19a919c2dc30cc4355bb Mon Sep 17 00:00:00 2001 From: ChinmoyDebnath Date: Mon, 8 Feb 2021 13:42:16 +0530 Subject: [PATCH 02/23] feat(deepintent-dpes): adds deepintent user id module --- modules/.submodules.json | 3 +- modules/deepintentDpesIdSystem.js | 78 +++++++++++++++++++++++++++++++ modules/deepintentDpesSystem.js | 18 ------- 3 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 modules/deepintentDpesIdSystem.js delete mode 100644 modules/deepintentDpesSystem.js diff --git a/modules/.submodules.json b/modules/.submodules.json index 18e75dd1794..0bfc293777e 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -15,7 +15,8 @@ "intentIqIdSystem", "zeotapIdPlusIdSystem", "haloIdSystem", - "quantcastIdSystem" + "quantcastIdSystem", + "deepintentDpesIdSystem" ], "adpod": [ "freeWheelAdserverVideo", diff --git a/modules/deepintentDpesIdSystem.js b/modules/deepintentDpesIdSystem.js new file mode 100644 index 00000000000..0782153a44e --- /dev/null +++ b/modules/deepintentDpesIdSystem.js @@ -0,0 +1,78 @@ +/** + * This module adds DPES to the User ID module + * The {@link module:modules/userId} module is required + * @module modules/deepintentDpesSubmodule + * @requires module:modules/userId + */ + +import * as utils from "../src/utils.js"; +import { submodule } from "../src/hook.js"; +import { getStorageManager } from "../src/storageManager.js"; + +const DEEPINTENT_DPES_ID = "di_dpes"; +export const storage = getStorageManager(); + +function readCookie(cookieName) { + // return 1231231; + const val = storage.cookiesAreEnabled ? storage.getCookie(cookieName) : null; + return JSON.parse(val); +} + +function readFromLocalStorage() { + const val = storage.localStorageIsEnabled + ? storage.getDataFromLocalStorage(DEEPINTENT_DPES_ID) + : null; + return JSON.parse(val); +} + +/** @type {Submodule} */ +export const deepintentDpesSubmodule = { + /** + * used to link submodule with config + * @type {string} + */ + name: "deepintentDpesIdSystem", + /** + * decode the stored id value for passing to bid requests + * @function + * @param { Object | string | undefined } value + * @return { Object | string | undefined } + */ + decode(value) { + console.log("isString: ", utils.isStr(value)); + console.log("isPlainObject: ", utils.isPlainObject(value)); + // const id = value + // ? utils.isStr(value) + // ? value + // : utils.isPlainObject(value) + // ? value.id + // : undefined + // : undefined; + return value ? value : undefined; + }, + /** + * performs action to obtain id and return a value in the callback's response argument + * @function + * @param {SubmoduleConfig} config + * @return {{id: string | undefined} | undefined} + */ + getId(config) { + const configParams = (config && config.params) || {}; + let id = null; + if ( + configParams && + Array.isArray(configParams.identifiersToResolve) && + configParams.identifiersToResolve.length > 0 && + configParams.type === "cookie" + ) { + id = readCookie(configParams.identifiersToResolve[0]); + } + if (configParams && configParams.type === "html5") { + id = readFromLocalStorage(); + } + console.log("getId: ", id); + return id ? { id } : undefined; + }, +}; + +submodule("userId", deepintentDpesSubmodule); diff --git a/modules/deepintentDpesSystem.js b/modules/deepintentDpesSystem.js deleted file mode 100644 index 047514a71d0..00000000000 --- a/modules/deepintentDpesSystem.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This module adds DPES to the User ID module - * The {@link module:modules/userId} module is required - * @module modules/deepintentDpesSubmodule - * @requires module:modules/userId - */ - - -import * as utils from '../src/utils.js' -import { ajax } from '../src/ajax.js'; -import { submodule } from '../src/hook.js'; - -/** @type {Submodule} */ -export const deepintentDpesSubmodule = { - -} - -submodule('userId',deepintentDpesSubmodule); \ No newline at end of file From 1537d7e09f4d0d730b34ef1f321192f4b23e34f0 Mon Sep 17 00:00:00 2001 From: ChinmoyDebnath Date: Mon, 8 Feb 2021 13:56:22 +0530 Subject: [PATCH 03/23] chore(code-cleanup): removed console logs --- modules/deepintentDpesIdSystem.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/modules/deepintentDpesIdSystem.js b/modules/deepintentDpesIdSystem.js index 0782153a44e..08a25f7f85d 100644 --- a/modules/deepintentDpesIdSystem.js +++ b/modules/deepintentDpesIdSystem.js @@ -39,15 +39,6 @@ export const deepintentDpesSubmodule = { * @return { Object | string | undefined } */ decode(value) { - console.log("isString: ", utils.isStr(value)); - console.log("isPlainObject: ", utils.isPlainObject(value)); - // const id = value - // ? utils.isStr(value) - // ? value - // : utils.isPlainObject(value) - // ? value.id - // : undefined - // : undefined; return value ? value : undefined; }, /** @@ -70,7 +61,6 @@ export const deepintentDpesSubmodule = { if (configParams && configParams.type === "html5") { id = readFromLocalStorage(); } - console.log("getId: ", id); return id ? { id } : undefined; }, }; From 913d88438fb66854f8bec55771968aa8e7b80c62 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 5 Apr 2021 21:31:40 +0530 Subject: [PATCH 04/23] eids config added --- modules/userId/eids.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/userId/eids.js b/modules/userId/eids.js index 80750ccaae8..ebc680e1003 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -172,6 +172,10 @@ const USER_IDS_CONFIG = { 'tapadId': { source: 'tapad.com', atype: 1 + }, + 'deepintentId': { + source: 'deepintent.com', + atype: 1 } }; From 61908ee79366c4f6434c56a175e40b41a54d59e8 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 5 Apr 2021 21:32:15 +0530 Subject: [PATCH 05/23] fix for passing the eids --- modules/deepintentDpesIdSystem.js | 51 +++++++++++++++++++------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/modules/deepintentDpesIdSystem.js b/modules/deepintentDpesIdSystem.js index 08a25f7f85d..91c243d414d 100644 --- a/modules/deepintentDpesIdSystem.js +++ b/modules/deepintentDpesIdSystem.js @@ -1,16 +1,17 @@ /** * This module adds DPES to the User ID module * The {@link module:modules/userId} module is required - * @module modules/deepintentDpesSubmodule + * @module modules/deepintentDpesSystem * @requires module:modules/userId */ -import * as utils from "../src/utils.js"; -import { submodule } from "../src/hook.js"; -import { getStorageManager } from "../src/storageManager.js"; +import * as utils from '../src/utils.js'; +import { submodule } from '../src/hook.js'; +import { getStorageManager } from '../src/storageManager.js'; -const DEEPINTENT_DPES_ID = "di_dpes"; -export const storage = getStorageManager(); +const MODULE_NAME = 'deepintentId'; +export const storage = getStorageManager(null, MODULE_NAME); +const DEEPINTENT_DPES_ID = 'di_dpes'; function readCookie(cookieName) { // return 1231231; @@ -31,15 +32,24 @@ export const deepintentDpesSubmodule = { * used to link submodule with config * @type {string} */ - name: "deepintentDpesIdSystem", + name: MODULE_NAME, /** * decode the stored id value for passing to bid requests * @function - * @param { Object | string | undefined } value - * @return { Object | string | undefined } + * @param {{value:string}} value + * @returns {{deepintentId:Object}} */ - decode(value) { - return value ? value : undefined; + decode(value, config) { + const configParams = (config && config.params) || {}; + if (configParams && configParams.identityKey && configParams.siteId && value.siteId && configParams.siteId == value.siteId) { + if (configParams.identityKey === 'hashedEmail') { + value = {'deepintentId': value.email} + return value; + } else if (configParams.identityKey === 'hashedNPI') { + value = {'deepintentId': value.npi} + return value; + } + } }, /** * performs action to obtain id and return a value in the callback's response argument @@ -48,21 +58,24 @@ export const deepintentDpesSubmodule = { * @return {{id: string | undefined} | undefined} */ getId(config) { - const configParams = (config && config.params) || {}; + const configStorage = (config && config.storage) || {}; + let id = null; if ( - configParams && - Array.isArray(configParams.identifiersToResolve) && - configParams.identifiersToResolve.length > 0 && - configParams.type === "cookie" + configStorage && + Array.isArray(configStorage.identifiersToResolve) && + configStorage.identifiersToResolve.length > 0 && + configStorage.name && + configStorage.type === 'cookie' ) { - id = readCookie(configParams.identifiersToResolve[0]); + id = readCookie(configStorage.name); } - if (configParams && configParams.type === "html5") { + if (configStorage && configStorage.type === 'html5') { id = readFromLocalStorage(); } + return id ? { id } : undefined; }, }; -submodule("userId", deepintentDpesSubmodule); +submodule('userId', deepintentDpesSubmodule); From bb149e35bd71c40efa6a1620b17732087091a3a5 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Wed, 7 Apr 2021 14:41:43 +0530 Subject: [PATCH 06/23] docs added with minor change --- modules/deepintentDpesIdSystem.js | 11 ++++--- modules/deepintentDpesIdSystem.md | 49 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 modules/deepintentDpesIdSystem.md diff --git a/modules/deepintentDpesIdSystem.js b/modules/deepintentDpesIdSystem.js index 91c243d414d..28e7a8ae1eb 100644 --- a/modules/deepintentDpesIdSystem.js +++ b/modules/deepintentDpesIdSystem.js @@ -5,7 +5,6 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js'; import { submodule } from '../src/hook.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -14,7 +13,6 @@ export const storage = getStorageManager(null, MODULE_NAME); const DEEPINTENT_DPES_ID = 'di_dpes'; function readCookie(cookieName) { - // return 1231231; const val = storage.cookiesAreEnabled ? storage.getCookie(cookieName) : null; return JSON.parse(val); } @@ -48,7 +46,11 @@ export const deepintentDpesSubmodule = { } else if (configParams.identityKey === 'hashedNPI') { value = {'deepintentId': value.npi} return value; + } else { + return undefined; } + } else { + return undefined; } }, /** @@ -63,14 +65,11 @@ export const deepintentDpesSubmodule = { let id = null; if ( configStorage && - Array.isArray(configStorage.identifiersToResolve) && - configStorage.identifiersToResolve.length > 0 && configStorage.name && configStorage.type === 'cookie' ) { id = readCookie(configStorage.name); - } - if (configStorage && configStorage.type === 'html5') { + } else if (configStorage && configStorage.type === 'html5') { id = readFromLocalStorage(); } diff --git a/modules/deepintentDpesIdSystem.md b/modules/deepintentDpesIdSystem.md new file mode 100644 index 00000000000..fcd7a48e889 --- /dev/null +++ b/modules/deepintentDpesIdSystem.md @@ -0,0 +1,49 @@ +# Deepintent DPES ID + +The Deepintent DPES ID or Healthcare Identity is a shared, neutral identifier that publishers and ad tech platforms can use to recognise users even in environments where 3rd party cookies are not available. The Deepintent DPES ID is designed to respect users' privacy choices and publishers’ preferences throughout the advertising value chain. + +## Deepintent DPES ID Registration + +The Deepintent DPES ID is free to use, but requires a simple registration with Deepintent. Please contact your sales rep to get started + + +## Deepintent DPES ID Configuration + +First, make sure to add the Deepintent submodule to your Prebid.js package with: + +``` +gulp build --modules=deepintentDpesIdSystem,userId +``` + +The following configuration parameters are available: + +```javascript +pbjs.setConfig({ + userSync: { + userIds: [{ + name: 'deepintentId', + params: { + siteId: 173, // change to the siteId number to the one you recieved from Deepintent. + identityKey: "hashedEmail" // HashedEmail or HashedNPI based on type of your integration + }, + storage: { + type: 'cookie', // "html5" is the required storage type option is "html5" + name: '_di', // change to the cookie name you wish to read from, optional if storage type is html5 + expires: 90 // storage lasts for 90 days, optional if storage type is html5 + } + }], + auctionDelay: 50 // 50ms maximum auction delay, applies to all userId modules + } +}); +``` + +| Param under userSync.userIds[] | Scope | Type | Description | Example | +| --- | --- | --- | --- | --- | +| name | Required | String | The name of this module: `"deepintentId"` | `"deepintentId"` | +| params | Required | Object | Details for the Deepinent DPES ID. | | +| params.siteId | Required | Number | This is the Deepintent site id obtained from registering with deepintent. | `10023` | +| params.identityKey | Required | String | This is identity type which healthcare identity will store by using healthcare identity module by deepintent it will be either "hashedEmail" or "hashedNPI" | `hashedEmai` | +| storage | Required | Object | Storage settings for how the User Id module will cache the Deepintent ID locally | | +| storage.type | Required | String | This is where the results of the user ID will be stored. Deepintent`"html5"` or `"cookie"`. | `"html5"` | +| storage.name | Optional | String | The name of the local storage where the user ID will be stored. Deepintent **required** for storage type `"cookie"`. | `"_di"` | +| storage.expires | Optional | Integer | How long (in days) the user ID information will be stored. Deepintent recommends `90`. | `90` | \ No newline at end of file From 3869ff5a694bdd9a5c7454ce8ea4ebb833bbf7dd Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Wed, 7 Apr 2021 14:42:03 +0530 Subject: [PATCH 07/23] tests added --- .../modules/deepintentDpesIdsystem_spec.js | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 test/spec/modules/deepintentDpesIdsystem_spec.js diff --git a/test/spec/modules/deepintentDpesIdsystem_spec.js b/test/spec/modules/deepintentDpesIdsystem_spec.js new file mode 100644 index 00000000000..57cbad57297 --- /dev/null +++ b/test/spec/modules/deepintentDpesIdsystem_spec.js @@ -0,0 +1,122 @@ +import { expect } from 'chai'; +import find from 'core-js-pure/features/array/find.js'; +import { storage, deepintentDpesSubmodule } from 'modules/deepintentDpesIdSystem.js'; +import { init, requestBidsHook, setSubmoduleRegistry } from 'modules/userId/index.js'; +import { config } from 'src/config.js'; + +const DI_COOKIE_NAME = '_di'; +const DI_LOCALSTORAGE_ID = 'di_dpes'; +const DI_DUMMY_VALUE = '{"email":"2cf40748c4f7f60d343336e08f80dc99","siteId":"80088"}'; +const DI_COOKIE_STORED = DI_DUMMY_VALUE; +const DI_EMAIL_DECODE_VALUE = { + email: '2cf40748c4f7f60d343336e08f80dc99', + siteId: '80088' +}; +const DI_NPI_DECODE_VALUE = { + npi: '2cf40748c4f7f60d343336e08f80dc99', + siteId: '80088' +}; +const DI_COOKIE_OBJECT = { + id: { + email: '2cf40748c4f7f60d343336e08f80dc99', + siteId: '80088' + } +}; +const cookieConfig = { + name: 'deepintentId', + params: { + identityKey: 'hashedEmail', + siteId: '80088' + }, + storage: { + type: 'cookie', + name: '_di', + expires: 28 + } +}; +const cookieNPIConfig = { + name: 'deepintentId', + params: { + identityKey: 'hashedNPI', + siteId: '80088' + }, + storage: { + type: 'cookie', + name: '_di', + expires: 28 + } +}; + +const html5Config = { + name: 'deepintentId', + params: { + identityKey: 'hashedEmail', + siteId: '80088' + }, + storage: { + type: 'html5' + } +}; + + +describe('Deepintent DPES System', () => { + let getDataFromLocalStorageStub, localStorageIsEnabledStub; + let getCookieStub, cookiesAreEnabledStub; + + beforeEach(() => { + getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage'); + localStorageIsEnabledStub = sinon.stub(storage, 'localStorageIsEnabled'); + getCookieStub = sinon.stub(storage, 'getCookie'); + cookiesAreEnabledStub = sinon.stub(storage, 'cookiesAreEnabled'); + }); + + afterEach(() => { + getDataFromLocalStorageStub.restore(); + localStorageIsEnabledStub.restore(); + getCookieStub.restore(); + cookiesAreEnabledStub.restore(); + }); + + describe('Deepintent Dpes Sytsem: test "getId" method', () => { + it('Wrong config should fail the tests', () => { + // no config + expect(deepintentDpesSubmodule.getId()).to.be.eq(undefined); + expect(deepintentDpesSubmodule.getId({ })).to.be.eq(undefined); + + expect(deepintentDpesSubmodule.getId({params: {}, storage: {}})).to.be.eq(undefined); + expect(deepintentDpesSubmodule.getId({params: {}, storage: {type: 'cookie'}})).to.be.eq(undefined); + expect(deepintentDpesSubmodule.getId({params: {}, storage: {name: '_di'}})).to.be.eq(undefined); + }); + + it('Get value stored in cookie for getId', () => { + getCookieStub.withArgs(DI_COOKIE_NAME).returns(DI_COOKIE_STORED); + let diId = deepintentDpesSubmodule.getId(cookieConfig); + expect(diId).to.deep.equal(DI_COOKIE_OBJECT); + }); + + it('provides the stored deepintentId if cookie is absent but present in local storage', () => { + getDataFromLocalStorageStub.withArgs(DI_LOCALSTORAGE_ID).returns(DI_COOKIE_STORED); + let idx = deepintentDpesSubmodule.getId(html5Config); + expect(idx).to.deep.equal(DI_COOKIE_OBJECT); + }); + }); + + describe('Deepintent Dpes System : test "decode" method', () => { + it('Wrong params passed via config', () => { + expect(deepintentDpesSubmodule.decode('test', {params: {}})).to.be.undefined; + expect(deepintentDpesSubmodule.decode('test', {params: {identityKey: 'hashedEmail'}})).to.be.undefined; + expect(deepintentDpesSubmodule.decode('test', {params: {identityKey: 'hashedNPI'}})).to.be.undefined; + expect(deepintentDpesSubmodule.decode('test', {params: {siteId: '80088'}})).to.be.undefined; + expect(deepintentDpesSubmodule.decode('test', {params: {siteId: '80088', identityKey: 'hello'}})).to.be.undefined; + }); + + it('Get the correct decoded value for dpes id', () => { + expect(deepintentDpesSubmodule.decode(DI_EMAIL_DECODE_VALUE, cookieConfig)).to.deep.equal({'deepintentId': '2cf40748c4f7f60d343336e08f80dc99'}); + expect(deepintentDpesSubmodule.decode(DI_NPI_DECODE_VALUE, cookieNPIConfig)).to.deep.equal({'deepintentId': '2cf40748c4f7f60d343336e08f80dc99'}); + }); + + it('Check for wrong siteId', () => { + expect(deepintentDpesSubmodule.decode(DI_EMAIL_DECODE_VALUE, {params: {siteId: '80090', identityKey: 'hashedEmail'}})).to.be.undefined; + }); + }); +}); From b6609fee8634d07eaf01858fa3d0c991a46be452 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Wed, 7 Apr 2021 18:57:20 +0530 Subject: [PATCH 08/23] remaining conflict resolution --- modules/.submodules.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/.submodules.json b/modules/.submodules.json index 44526d5a3a6..137321e03e0 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -16,11 +16,8 @@ "zeotapIdPlusIdSystem", "haloIdSystem", "quantcastIdSystem", -<<<<<<< HEAD "deepintentDpesIdSystem", -======= "nextrollIdSystem", ->>>>>>> 81fc1ce9b8471cadb33ebc10a270e8c6d001ea98 "idxIdSystem", "fabrickIdSystem", "verizonMediaIdSystem", From 85be2a6887c15c10b0335cbfb6a7da9ea2ae2ba1 Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Wed, 7 Apr 2021 08:53:43 -0700 Subject: [PATCH 09/23] kick off circle-ci tests manually From 7efa21041770d8a377a1502ecba4bedcea84409d Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Wed, 7 Apr 2021 08:57:34 -0700 Subject: [PATCH 10/23] fix linting error --- test/spec/modules/deepintentDpesIdsystem_spec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/spec/modules/deepintentDpesIdsystem_spec.js b/test/spec/modules/deepintentDpesIdsystem_spec.js index 57cbad57297..7b8be613498 100644 --- a/test/spec/modules/deepintentDpesIdsystem_spec.js +++ b/test/spec/modules/deepintentDpesIdsystem_spec.js @@ -58,7 +58,6 @@ const html5Config = { } }; - describe('Deepintent DPES System', () => { let getDataFromLocalStorageStub, localStorageIsEnabledStub; let getCookieStub, cookiesAreEnabledStub; From c17647aa1acca00cacb339004834ca0c891413ab Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Thu, 8 Apr 2021 15:50:02 +0530 Subject: [PATCH 11/23] changed the atype to 3 --- modules/userId/eids.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/userId/eids.js b/modules/userId/eids.js index 6a6673a8d80..93d2ead15ea 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -209,7 +209,7 @@ const USER_IDS_CONFIG = { }, 'deepintentId': { source: 'deepintent.com', - atype: 1 + atype: 3 }, // Admixer Id 'admixerId': { From aedd254178fcf9aa85d2fff00868290f969b8446 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Fri, 9 Apr 2021 07:22:56 +0530 Subject: [PATCH 12/23] tests added for eids_spec.js --- test/spec/modules/eids_spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/spec/modules/eids_spec.js b/test/spec/modules/eids_spec.js index 86a6dff2205..1ccaab2b302 100644 --- a/test/spec/modules/eids_spec.js +++ b/test/spec/modules/eids_spec.js @@ -189,6 +189,18 @@ describe('eids array generation for known sub-modules', function() { }); }); + it('deepintentId', function() { + const userId = { + deepintentId: 'some-random-id-value' + }; + const newEids = createEidsArray(userId); + expect(newEids.length).to.equal(1); + expect(newEids[0]).to.deep.equal({ + source: 'deepintent.com', + uids: [{id: 'some-random-id-value', atype: 3}] + }); + }); + it('NetId', function() { const userId = { netId: 'some-random-id-value' From dddf04187e9abf8149302d7ce6b28466c8602d96 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 07:54:18 +0530 Subject: [PATCH 13/23] Change the language --- modules/deepintentDpesIdSystem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/deepintentDpesIdSystem.md b/modules/deepintentDpesIdSystem.md index fcd7a48e889..0b7cec8aa3e 100644 --- a/modules/deepintentDpesIdSystem.md +++ b/modules/deepintentDpesIdSystem.md @@ -1,6 +1,6 @@ # Deepintent DPES ID -The Deepintent DPES ID or Healthcare Identity is a shared, neutral identifier that publishers and ad tech platforms can use to recognise users even in environments where 3rd party cookies are not available. The Deepintent DPES ID is designed to respect users' privacy choices and publishers’ preferences throughout the advertising value chain. +The Deepintent Id is a shared, healthcare identifier which helps publisher in absence of the 3rd Party cookie matching. This lets publishers set and bid with healthcare identity . Deepintent lets users protect their privacy through advertising value chain, where Healthcare identity when setting the identity takes in consideration of users choices, as well as when passing identity on the cookie itself privacy consent strings are checked. The healthcare identity when set is not stored on Deepintent's servers but is stored on users browsers itself. User can still opt out of the ads by https://option.deepintent.com/adchoices ## Deepintent DPES ID Registration From 13801ac7f6fd849bc3c523221e04a6254ed940f7 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 14:07:26 +0530 Subject: [PATCH 14/23] added cacheIdObject signature --- modules/deepintentDpesIdSystem.js | 49 +++++++------------------------ 1 file changed, 10 insertions(+), 39 deletions(-) diff --git a/modules/deepintentDpesIdSystem.js b/modules/deepintentDpesIdSystem.js index 28e7a8ae1eb..425b965e57d 100644 --- a/modules/deepintentDpesIdSystem.js +++ b/modules/deepintentDpesIdSystem.js @@ -10,19 +10,6 @@ import { getStorageManager } from '../src/storageManager.js'; const MODULE_NAME = 'deepintentId'; export const storage = getStorageManager(null, MODULE_NAME); -const DEEPINTENT_DPES_ID = 'di_dpes'; - -function readCookie(cookieName) { - const val = storage.cookiesAreEnabled ? storage.getCookie(cookieName) : null; - return JSON.parse(val); -} - -function readFromLocalStorage() { - const val = storage.localStorageIsEnabled - ? storage.getDataFromLocalStorage(DEEPINTENT_DPES_ID) - : null; - return JSON.parse(val); -} /** @type {Submodule} */ export const deepintentDpesSubmodule = { @@ -38,43 +25,27 @@ export const deepintentDpesSubmodule = { * @returns {{deepintentId:Object}} */ decode(value, config) { - const configParams = (config && config.params) || {}; - if (configParams && configParams.identityKey && configParams.siteId && value.siteId && configParams.siteId == value.siteId) { - if (configParams.identityKey === 'hashedEmail') { - value = {'deepintentId': value.email} - return value; - } else if (configParams.identityKey === 'hashedNPI') { - value = {'deepintentId': value.npi} - return value; - } else { - return undefined; + if (value) { + return { + 'deepintentId': value } } else { - return undefined; + return undefined } }, + /** * performs action to obtain id and return a value in the callback's response argument * @function * @param {SubmoduleConfig} config + * @param {ConsentData|undefined} consentData + * @param {Object} cacheIdObj - existing id, if any * @return {{id: string | undefined} | undefined} */ - getId(config) { - const configStorage = (config && config.storage) || {}; + getId(config, consentData, cacheIdObj) { + return cacheIdObj; + } - let id = null; - if ( - configStorage && - configStorage.name && - configStorage.type === 'cookie' - ) { - id = readCookie(configStorage.name); - } else if (configStorage && configStorage.type === 'html5') { - id = readFromLocalStorage(); - } - - return id ? { id } : undefined; - }, }; submodule('userId', deepintentDpesSubmodule); From 4a8f8dbcb92da5de26d44507c6bf631784458f38 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 14:07:56 +0530 Subject: [PATCH 15/23] changed test cases --- .../modules/deepintentDpesIdsystem_spec.js | 73 ++++--------------- 1 file changed, 14 insertions(+), 59 deletions(-) diff --git a/test/spec/modules/deepintentDpesIdsystem_spec.js b/test/spec/modules/deepintentDpesIdsystem_spec.js index 7b8be613498..7ea5553393c 100644 --- a/test/spec/modules/deepintentDpesIdsystem_spec.js +++ b/test/spec/modules/deepintentDpesIdsystem_spec.js @@ -4,59 +4,27 @@ import { storage, deepintentDpesSubmodule } from 'modules/deepintentDpesIdSystem import { init, requestBidsHook, setSubmoduleRegistry } from 'modules/userId/index.js'; import { config } from 'src/config.js'; -const DI_COOKIE_NAME = '_di'; -const DI_LOCALSTORAGE_ID = 'di_dpes'; -const DI_DUMMY_VALUE = '{"email":"2cf40748c4f7f60d343336e08f80dc99","siteId":"80088"}'; -const DI_COOKIE_STORED = DI_DUMMY_VALUE; -const DI_EMAIL_DECODE_VALUE = { - email: '2cf40748c4f7f60d343336e08f80dc99', - siteId: '80088' -}; -const DI_NPI_DECODE_VALUE = { - npi: '2cf40748c4f7f60d343336e08f80dc99', - siteId: '80088' -}; -const DI_COOKIE_OBJECT = { - id: { - email: '2cf40748c4f7f60d343336e08f80dc99', - siteId: '80088' - } -}; +const DI_COOKIE_NAME = '_dpes_id'; +const DI_COOKIE_STORED = '{"id":"2cf40748c4f7f60d343336e08f80dc99"}'; +const DI_COOKIE_OBJECT = {id: '2cf40748c4f7f60d343336e08f80dc99'}; + const cookieConfig = { name: 'deepintentId', - params: { - identityKey: 'hashedEmail', - siteId: '80088' - }, storage: { type: 'cookie', - name: '_di', - expires: 28 - } -}; -const cookieNPIConfig = { - name: 'deepintentId', - params: { - identityKey: 'hashedNPI', - siteId: '80088' - }, - storage: { - type: 'cookie', - name: '_di', + name: '_dpes_id', expires: 28 } }; const html5Config = { name: 'deepintentId', - params: { - identityKey: 'hashedEmail', - siteId: '80088' - }, storage: { - type: 'html5' + type: 'html5', + name: '_dpes_id', + expires: 28 } -}; +} describe('Deepintent DPES System', () => { let getDataFromLocalStorageStub, localStorageIsEnabledStub; @@ -84,38 +52,25 @@ describe('Deepintent DPES System', () => { expect(deepintentDpesSubmodule.getId({params: {}, storage: {}})).to.be.eq(undefined); expect(deepintentDpesSubmodule.getId({params: {}, storage: {type: 'cookie'}})).to.be.eq(undefined); - expect(deepintentDpesSubmodule.getId({params: {}, storage: {name: '_di'}})).to.be.eq(undefined); + expect(deepintentDpesSubmodule.getId({params: {}, storage: {name: '_dpes_id'}})).to.be.eq(undefined); }); it('Get value stored in cookie for getId', () => { getCookieStub.withArgs(DI_COOKIE_NAME).returns(DI_COOKIE_STORED); - let diId = deepintentDpesSubmodule.getId(cookieConfig); + let diId = deepintentDpesSubmodule.getId(cookieConfig, undefined, DI_COOKIE_OBJECT); expect(diId).to.deep.equal(DI_COOKIE_OBJECT); }); it('provides the stored deepintentId if cookie is absent but present in local storage', () => { - getDataFromLocalStorageStub.withArgs(DI_LOCALSTORAGE_ID).returns(DI_COOKIE_STORED); - let idx = deepintentDpesSubmodule.getId(html5Config); + getDataFromLocalStorageStub.withArgs(DI_COOKIE_NAME).returns(DI_COOKIE_STORED); + let idx = deepintentDpesSubmodule.getId(html5Config, undefined, DI_COOKIE_OBJECT); expect(idx).to.deep.equal(DI_COOKIE_OBJECT); }); }); describe('Deepintent Dpes System : test "decode" method', () => { - it('Wrong params passed via config', () => { - expect(deepintentDpesSubmodule.decode('test', {params: {}})).to.be.undefined; - expect(deepintentDpesSubmodule.decode('test', {params: {identityKey: 'hashedEmail'}})).to.be.undefined; - expect(deepintentDpesSubmodule.decode('test', {params: {identityKey: 'hashedNPI'}})).to.be.undefined; - expect(deepintentDpesSubmodule.decode('test', {params: {siteId: '80088'}})).to.be.undefined; - expect(deepintentDpesSubmodule.decode('test', {params: {siteId: '80088', identityKey: 'hello'}})).to.be.undefined; - }); - it('Get the correct decoded value for dpes id', () => { - expect(deepintentDpesSubmodule.decode(DI_EMAIL_DECODE_VALUE, cookieConfig)).to.deep.equal({'deepintentId': '2cf40748c4f7f60d343336e08f80dc99'}); - expect(deepintentDpesSubmodule.decode(DI_NPI_DECODE_VALUE, cookieNPIConfig)).to.deep.equal({'deepintentId': '2cf40748c4f7f60d343336e08f80dc99'}); - }); - - it('Check for wrong siteId', () => { - expect(deepintentDpesSubmodule.decode(DI_EMAIL_DECODE_VALUE, {params: {siteId: '80090', identityKey: 'hashedEmail'}})).to.be.undefined; + expect(deepintentDpesSubmodule.decode(DI_COOKIE_OBJECT, cookieConfig)).to.deep.equal({'deepintentId': {'id': '2cf40748c4f7f60d343336e08f80dc99'}}); }); }); }); From ea11f5c2d1734868b63ad15e1ec8501d349b6adc Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 14:09:35 +0530 Subject: [PATCH 16/23] eIds passing added to adapter --- modules/deepintentBidAdapter.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/deepintentBidAdapter.js b/modules/deepintentBidAdapter.js index c4dc23cf912..9ec6c8e5bc2 100644 --- a/modules/deepintentBidAdapter.js +++ b/modules/deepintentBidAdapter.js @@ -49,6 +49,8 @@ export const spec = { utils.deepSetValue(openRtbBidRequest, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); } + injectEids(openRtbBidRequest, validBidRequests); + return { method: 'POST', url: BIDDER_ENDPOINT, @@ -128,6 +130,13 @@ function buildUser(bid) { } } +function injectEids(openRtbBidRequest, validBidRequests) { + const bidUserIdAsEids = utils.deepAccess(validBidRequests, '0.userIdAsEids'); + if (utils.isArray(bidUserIdAsEids) && bidUserIdAsEids.length > 0) { + utils.deepSetValue(openRtbBidRequest, 'user.eids', bidUserIdAsEids); + } +} + function buildBanner(bid) { if (utils.deepAccess(bid, 'mediaTypes.banner')) { // Get Sizes from MediaTypes Object, Will always take first size, will be overrided by params for exact w,h From a59bc43f4cc9d9de794bdd0f020d5dbe3f396cbe Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 14:13:32 +0530 Subject: [PATCH 17/23] docs changed removed params not required --- modules/deepintentDpesIdSystem.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/deepintentDpesIdSystem.md b/modules/deepintentDpesIdSystem.md index 0b7cec8aa3e..0aa848df11e 100644 --- a/modules/deepintentDpesIdSystem.md +++ b/modules/deepintentDpesIdSystem.md @@ -22,13 +22,9 @@ pbjs.setConfig({ userSync: { userIds: [{ name: 'deepintentId', - params: { - siteId: 173, // change to the siteId number to the one you recieved from Deepintent. - identityKey: "hashedEmail" // HashedEmail or HashedNPI based on type of your integration - }, storage: { - type: 'cookie', // "html5" is the required storage type option is "html5" - name: '_di', // change to the cookie name you wish to read from, optional if storage type is html5 + type: 'cookie', + name: '_dpes_id', expires: 90 // storage lasts for 90 days, optional if storage type is html5 } }], @@ -40,10 +36,7 @@ pbjs.setConfig({ | Param under userSync.userIds[] | Scope | Type | Description | Example | | --- | --- | --- | --- | --- | | name | Required | String | The name of this module: `"deepintentId"` | `"deepintentId"` | -| params | Required | Object | Details for the Deepinent DPES ID. | | -| params.siteId | Required | Number | This is the Deepintent site id obtained from registering with deepintent. | `10023` | -| params.identityKey | Required | String | This is identity type which healthcare identity will store by using healthcare identity module by deepintent it will be either "hashedEmail" or "hashedNPI" | `hashedEmai` | | storage | Required | Object | Storage settings for how the User Id module will cache the Deepintent ID locally | | | storage.type | Required | String | This is where the results of the user ID will be stored. Deepintent`"html5"` or `"cookie"`. | `"html5"` | -| storage.name | Optional | String | The name of the local storage where the user ID will be stored. Deepintent **required** for storage type `"cookie"`. | `"_di"` | +| storage.name | Required | String | The name of the local storage where the user ID will be stored. | `"_dpes_id"` | | storage.expires | Optional | Integer | How long (in days) the user ID information will be stored. Deepintent recommends `90`. | `90` | \ No newline at end of file From e83e185da0fab69ae107983ca61e919f95c745cc Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 14:14:26 +0530 Subject: [PATCH 18/23] doc added --- modules/userId/eids.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/userId/eids.md b/modules/userId/eids.md index 93783a2db4d..a00aedcc52e 100644 --- a/modules/userId/eids.md +++ b/modules/userId/eids.md @@ -184,6 +184,13 @@ userIdAsEids = [ id: 'some-random-id-value', atype: 3 }] + }, + { + source: 'deepintent.com', + uids: [{ + id: 'some-random-id-value', + atype: 3 + }] } ] ``` From d0b7d0f819912a0fc4fe286038ec907877f01ade Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 14:18:52 +0530 Subject: [PATCH 19/23] docs added in userId base --- modules/userId/userId.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/userId/userId.md b/modules/userId/userId.md index aa72146c47c..2ccab4c20e6 100644 --- a/modules/userId/userId.md +++ b/modules/userId/userId.md @@ -220,6 +220,20 @@ pbjs.setConfig({ name: 'admixerId', expires: 30 } + },{ + name: "deepintentId", + storage: { + type: "html5", + name: "_dpes_id", + expires: 90 + } + },{ + name: "deepintentId", + storage: { + type: "cookie", + name: "_dpes_id", + expires: 90 + } }], syncDelay: 5000 } From c553898a533e8080a82745d8c1eefae2f1fca311 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 15:49:07 +0530 Subject: [PATCH 20/23] user id tests added --- test/spec/modules/userId_spec.js | 109 ++++++++++++++++++++++++++----- 1 file changed, 92 insertions(+), 17 deletions(-) diff --git a/test/spec/modules/userId_spec.js b/test/spec/modules/userId_spec.js index 3c852f3af5c..4f320e5621e 100644 --- a/test/spec/modules/userId_spec.js +++ b/test/spec/modules/userId_spec.js @@ -44,6 +44,7 @@ import {tapadIdSubmodule} from 'modules/tapadIdSystem.js'; import {getPrebidInternal} from 'src/utils.js'; import {uid2IdSubmodule} from 'modules/uid2IdSystem.js'; import {admixerIdSubmodule} from 'modules/admixerIdSystem.js'; +import {deepintentDpesSubmodule} from 'modules/deepintentDpesIdSystem.js'; let assert = require('chai').assert; let expect = require('chai').expect; @@ -462,7 +463,7 @@ describe('User ID', function () { }); it('handles config with no usersync object', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig({}); // usersync is undefined, and no logInfo message for 'User ID - usersync config updated' @@ -470,14 +471,14 @@ describe('User ID', function () { }); it('handles config with empty usersync object', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig({userSync: {}}); expect(typeof utils.logInfo.args[0]).to.equal('undefined'); }); it('handles config with usersync and userIds that are empty objs', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -488,7 +489,7 @@ describe('User ID', function () { }); it('handles config with usersync and userIds with empty names or that dont match a submodule.name', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -505,7 +506,7 @@ describe('User ID', function () { }); it('config with 1 configurations should create 1 submodules', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig(getConfigMock(['unifiedId', 'unifiedid', 'cookie'])); @@ -513,7 +514,7 @@ describe('User ID', function () { }); it('config with 17 configurations should result in 18 submodules add', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, liveIntentIdSubmodule, britepoolIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, liveIntentIdSubmodule, britepoolIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -565,14 +566,17 @@ describe('User ID', function () { }, { name: 'admixerId', storage: {name: 'admixerId', type: 'cookie'} + },{ + name: 'deepintentId', + storage: {name: 'deepintentId',type:'cookie'} }] } }); - expect(utils.logInfo.args[0][0]).to.exist.and.to.contain('User ID - usersync config updated for 18 submodules'); + expect(utils.logInfo.args[0][0]).to.exist.and.to.contain('User ID - usersync config updated for 19 submodules'); }); it('config syncDelay updates module correctly', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -587,7 +591,7 @@ describe('User ID', function () { }); it('config auctionDelay updates module correctly', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -602,7 +606,7 @@ describe('User ID', function () { }); it('config auctionDelay defaults to 0 if not a number', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -1702,6 +1706,53 @@ describe('User ID', function () { }, {adUnits}); }); + it('test hook from deepintentId cookies', function (done) { + // simulate existing browser local storage values + coreStorage.setCookie('deepintentId','testdeepintentId', (new Date(Date.now() + 5000).toUTCString())); + + setSubmoduleRegistry([deepintentDpesSubmodule]); + init(config); + config.setConfig(getConfigMock(['deepintentId', 'deepintentId', 'cookie'])); + + requestBidsHook(function () { + adUnits.forEach(unit => { + unit.bids.forEach(bid => { + expect(bid).to.have.deep.nested.property('userId.deepintentId'); + expect(bid.userId.deepintentId).to.deep.equal('testdeepintentId'); + expect(bid.userIdAsEids[0]).to.deep.equal({ + source: 'deepintent.com', + uids: [{id: 'testdeepintentId', atype: 3}] + }); + }); + }); + coreStorage.setCookie('deepintentId', '', EXPIRED_COOKIE_DATE); + done(); + }, {adUnits}); + }); + + it('test hook from deepintentId html5', function (done) { + // simulate existing browser local storage values + localStorage.setItem('deepintentId', 'testdeepintentId'); + localStorage.setItem('deepintentId_exp', ''); + + setSubmoduleRegistry([deepintentDpesSubmodule]); + init(config); + config.setConfig(getConfigMock(['deepintentId', 'deepintentId', 'html5'])); + requestBidsHook(function () { + adUnits.forEach(unit => { + unit.bids.forEach(bid => { + expect(bid).to.have.deep.nested.property('userId.deepintentId'); + expect(bid.userIdAsEids[0]).to.deep.equal({ + source: 'deepintent.com', + uids: [{id: 'testdeepintentId', atype: 3}] + }); + }); + }); + localStorage.removeItem('deepintentId'); + done(); + }, {adUnits}); + }); + it('test hook when pubCommonId, unifiedId, id5Id, identityLink, britepoolId, intentIqId, zeotapIdPlus, sharedId, netId, haloId, Criteo, UID 2.0, admixerId and mwOpenLinkId have data to pass', function (done) { coreStorage.setCookie('pubcid', 'testpubcid', (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('unifiedid', JSON.stringify({'TDID': 'testunifiedid'}), (new Date(Date.now() + 5000).toUTCString())); @@ -1720,8 +1771,9 @@ describe('User ID', function () { coreStorage.setCookie('mwol', JSON.stringify({eid: 'XX-YY-ZZ-123'}), (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('uid2id', 'Sample_AD_Token', (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('admixerId', 'testadmixerId', (new Date(Date.now() + 5000).toUTCString())); + coreStorage.setCookie('deepintentId','testdeepintentId',(new Date(Date.now() + 5000).toUTCString())); - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, britepoolIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, britepoolIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig(getConfigMock(['pubCommonId', 'pubcid', 'cookie'], ['unifiedId', 'unifiedid', 'cookie'], @@ -1737,7 +1789,8 @@ describe('User ID', function () { ['mwOpenLinkId', 'mwol', 'cookie'], ['tapadId', 'tapad_id', 'cookie'], ['uid2', 'uid2id', 'cookie'], - ['admixerId', 'admixerId', 'cookie'])); + ['admixerId', 'admixerId', 'cookie'], + ['deepintentId','deepintentId','cookie'])); requestBidsHook(function () { adUnits.forEach(unit => { @@ -1787,7 +1840,11 @@ describe('User ID', function () { expect(bid).to.have.deep.nested.property('userId.admixerId'); expect(bid.userId.admixerId).to.equal('testadmixerId'); - expect(bid.userIdAsEids.length).to.equal(14); + // also check that deepintentId was copied to bid + expect(bid).to.have.deep.nested.property('userId.deepintentId'); + expect(bid.userId.deepintentId).to.equal('testdeepintentId'); + + expect(bid.userIdAsEids.length).to.equal(15); }); }); coreStorage.setCookie('pubcid', '', EXPIRED_COOKIE_DATE); @@ -1804,6 +1861,7 @@ describe('User ID', function () { coreStorage.setCookie('mwol', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('uid2id', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('admixerId', '', EXPIRED_COOKIE_DATE); + coreStorage.setCookie('deepintentId',EXPIRED_COOKIE_DATE); done(); }, {adUnits}); }); @@ -1826,6 +1884,7 @@ describe('User ID', function () { coreStorage.setCookie('mwol', JSON.stringify({eid: 'XX-YY-ZZ-123'}), (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('uid2id', 'Sample_AD_Token', (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('admixerId', 'testadmixerId', (new Date(Date.now() + 5000).toUTCString())); + coreStorage.setCookie('deepintentId','testdeepintentId',(new Date(Date.now() + 5000).toUTCString())); setSubmoduleRegistry([]); @@ -1849,6 +1908,7 @@ describe('User ID', function () { attachIdSystem(tapadIdSubmodule); attachIdSystem(uid2IdSubmodule); attachIdSystem(admixerIdSubmodule); + attachIdSystem(deepintentDpesSubmodule); config.setConfig(getConfigMock(['pubCommonId', 'pubcid', 'cookie'], ['unifiedId', 'unifiedid', 'cookie'], @@ -1864,7 +1924,8 @@ describe('User ID', function () { ['mwOpenLinkId', 'mwol', 'cookie'], ['tapadId', 'tapad_id', 'cookie'], ['uid2', 'uid2id', 'cookie'], - ['admixerId', 'admixerId', 'cookie'])); + ['admixerId', 'admixerId', 'cookie'], + ['deepintentId','deepintentId','cookie'])); requestBidsHook(function () { adUnits.forEach(unit => { @@ -1917,8 +1978,12 @@ describe('User ID', function () { // also check that admixerId id data was copied to bid expect(bid).to.have.deep.nested.property('userId.admixerId'); expect(bid.userId.admixerId).to.equal('testadmixerId'); + + // also check that deepintentId was copied to bid + expect(bid).to.have.deep.nested.property('userId.deepintentId'); + expect(bid.userId.deepintentId).to.equal('testdeepintentId'); - expect(bid.userIdAsEids.length).to.equal(14); + expect(bid.userIdAsEids.length).to.equal(15); }); }); coreStorage.setCookie('pubcid', '', EXPIRED_COOKIE_DATE); @@ -1935,6 +2000,7 @@ describe('User ID', function () { coreStorage.setCookie('mwol', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('uid2id', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('admixerId', '', EXPIRED_COOKIE_DATE); + coreStorage.setCookie('deepintentId', '', EXPIRED_COOKIE_DATE); done(); }, {adUnits}); }); @@ -2192,10 +2258,11 @@ describe('User ID', function () { coreStorage.setCookie('IDP', btoa(JSON.stringify('zeotapId')), (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('haloId', JSON.stringify({'haloId': 'testHaloId'}), (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('admixerId', 'testadmixerId', new Date(Date.now() + 5000).toUTCString()); + coreStorage.setCookie('deepintentId', 'testdeepintentId', new Date(Date.now() + 5000).toUTCString()); coreStorage.setCookie('MOCKID', JSON.stringify({'MOCKID': '123456778'}), new Date(Date.now() + 5000).toUTCString()); coreStorage.setCookie('__uid2_advertising_token', 'Sample_AD_Token', (new Date(Date.now() + 5000).toUTCString())); - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, britepoolIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, uid2IdSubmodule, admixerIdSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, britepoolIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); init(config); config.setConfig({ @@ -2227,6 +2294,8 @@ describe('User ID', function () { name: 'mockId', storage: {name: 'MOCKID', type: 'cookie'} }, { name: 'uid2' + },{ + name: 'deepintentId', storage: {name:'deepintentId',type:'cookie'} }] } }); @@ -2291,7 +2360,12 @@ describe('User ID', function () { // also check that admixerId id data was copied to bid expect(bid).to.have.deep.nested.property('userId.admixerId'); expect(bid.userId.admixerId).to.equal('testadmixerId'); - expect(bid.userIdAsEids.length).to.equal(12); + + // also check that deepintentId was copied to bid + expect(bid).to.have.deep.nested.property('userId.deepintentId'); + expect(bid.userId.deepintentId).to.equal('testdeepintentId'); + + expect(bid.userIdAsEids.length).to.equal(13); }); }); coreStorage.setCookie('pubcid', '', EXPIRED_COOKIE_DATE); @@ -2305,6 +2379,7 @@ describe('User ID', function () { coreStorage.setCookie('IDP', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('haloId', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('admixerId', '', EXPIRED_COOKIE_DATE); + coreStorage.setCookie('deepintentId', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('MOCKID', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('mwol', '', EXPIRED_COOKIE_DATE); done(); From 28133f24fb316a3b3bd9df10fc5a84d748d5a880 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 16:07:35 +0530 Subject: [PATCH 21/23] lint fixes --- test/spec/modules/userId_spec.js | 39 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/test/spec/modules/userId_spec.js b/test/spec/modules/userId_spec.js index 4f320e5621e..c5a1443737c 100644 --- a/test/spec/modules/userId_spec.js +++ b/test/spec/modules/userId_spec.js @@ -463,7 +463,7 @@ describe('User ID', function () { }); it('handles config with no usersync object', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig({}); // usersync is undefined, and no logInfo message for 'User ID - usersync config updated' @@ -471,14 +471,14 @@ describe('User ID', function () { }); it('handles config with empty usersync object', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig({userSync: {}}); expect(typeof utils.logInfo.args[0]).to.equal('undefined'); }); it('handles config with usersync and userIds that are empty objs', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -489,7 +489,7 @@ describe('User ID', function () { }); it('handles config with usersync and userIds with empty names or that dont match a submodule.name', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, merkleIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -506,7 +506,7 @@ describe('User ID', function () { }); it('config with 1 configurations should create 1 submodules', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig(getConfigMock(['unifiedId', 'unifiedid', 'cookie'])); @@ -514,7 +514,7 @@ describe('User ID', function () { }); it('config with 17 configurations should result in 18 submodules add', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, liveIntentIdSubmodule, britepoolIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, liveIntentIdSubmodule, britepoolIdSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -568,7 +568,7 @@ describe('User ID', function () { storage: {name: 'admixerId', type: 'cookie'} },{ name: 'deepintentId', - storage: {name: 'deepintentId',type:'cookie'} + storage: {name: 'deepintentId', type: 'cookie'} }] } }); @@ -576,7 +576,7 @@ describe('User ID', function () { }); it('config syncDelay updates module correctly', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -591,7 +591,7 @@ describe('User ID', function () { }); it('config auctionDelay updates module correctly', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -606,7 +606,7 @@ describe('User ID', function () { }); it('config auctionDelay defaults to 0 if not a number', function () { - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, netIdSubmodule, nextrollIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, pubProvidedIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig({ userSync: { @@ -1708,7 +1708,7 @@ describe('User ID', function () { it('test hook from deepintentId cookies', function (done) { // simulate existing browser local storage values - coreStorage.setCookie('deepintentId','testdeepintentId', (new Date(Date.now() + 5000).toUTCString())); + coreStorage.setCookie('deepintentId', 'testdeepintentId', (new Date(Date.now() + 5000).toUTCString())); setSubmoduleRegistry([deepintentDpesSubmodule]); init(config); @@ -1771,9 +1771,9 @@ describe('User ID', function () { coreStorage.setCookie('mwol', JSON.stringify({eid: 'XX-YY-ZZ-123'}), (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('uid2id', 'Sample_AD_Token', (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('admixerId', 'testadmixerId', (new Date(Date.now() + 5000).toUTCString())); - coreStorage.setCookie('deepintentId','testdeepintentId',(new Date(Date.now() + 5000).toUTCString())); + coreStorage.setCookie('deepintentId', 'testdeepintentId', (new Date(Date.now() + 5000).toUTCString())); - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, britepoolIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, britepoolIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, criteoIdSubmodule, mwOpenLinkIdSubModule, tapadIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig(getConfigMock(['pubCommonId', 'pubcid', 'cookie'], ['unifiedId', 'unifiedid', 'cookie'], @@ -1790,7 +1790,7 @@ describe('User ID', function () { ['tapadId', 'tapad_id', 'cookie'], ['uid2', 'uid2id', 'cookie'], ['admixerId', 'admixerId', 'cookie'], - ['deepintentId','deepintentId','cookie'])); + ['deepintentId', 'deepintentId', 'cookie'])); requestBidsHook(function () { adUnits.forEach(unit => { @@ -1861,7 +1861,7 @@ describe('User ID', function () { coreStorage.setCookie('mwol', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('uid2id', '', EXPIRED_COOKIE_DATE); coreStorage.setCookie('admixerId', '', EXPIRED_COOKIE_DATE); - coreStorage.setCookie('deepintentId',EXPIRED_COOKIE_DATE); + coreStorage.setCookie('deepintentId', EXPIRED_COOKIE_DATE); done(); }, {adUnits}); }); @@ -1884,7 +1884,7 @@ describe('User ID', function () { coreStorage.setCookie('mwol', JSON.stringify({eid: 'XX-YY-ZZ-123'}), (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('uid2id', 'Sample_AD_Token', (new Date(Date.now() + 5000).toUTCString())); coreStorage.setCookie('admixerId', 'testadmixerId', (new Date(Date.now() + 5000).toUTCString())); - coreStorage.setCookie('deepintentId','testdeepintentId',(new Date(Date.now() + 5000).toUTCString())); + coreStorage.setCookie('deepintentId', 'testdeepintentId', (new Date(Date.now() + 5000).toUTCString())); setSubmoduleRegistry([]); @@ -1925,7 +1925,7 @@ describe('User ID', function () { ['tapadId', 'tapad_id', 'cookie'], ['uid2', 'uid2id', 'cookie'], ['admixerId', 'admixerId', 'cookie'], - ['deepintentId','deepintentId','cookie'])); + ['deepintentId', 'deepintentId', 'cookie'])); requestBidsHook(function () { adUnits.forEach(unit => { @@ -1978,7 +1978,6 @@ describe('User ID', function () { // also check that admixerId id data was copied to bid expect(bid).to.have.deep.nested.property('userId.admixerId'); expect(bid.userId.admixerId).to.equal('testadmixerId'); - // also check that deepintentId was copied to bid expect(bid).to.have.deep.nested.property('userId.deepintentId'); expect(bid.userId.deepintentId).to.equal('testdeepintentId'); @@ -2262,7 +2261,7 @@ describe('User ID', function () { coreStorage.setCookie('MOCKID', JSON.stringify({'MOCKID': '123456778'}), new Date(Date.now() + 5000).toUTCString()); coreStorage.setCookie('__uid2_advertising_token', 'Sample_AD_Token', (new Date(Date.now() + 5000).toUTCString())); - setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, britepoolIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, uid2IdSubmodule, admixerIdSubmodule,deepintentDpesSubmodule]); + setSubmoduleRegistry([pubCommonIdSubmodule, unifiedIdSubmodule, id5IdSubmodule, identityLinkSubmodule, britepoolIdSubmodule, netIdSubmodule, sharedIdSubmodule, intentIqIdSubmodule, zeotapIdPlusSubmodule, haloIdSubmodule, uid2IdSubmodule, admixerIdSubmodule, deepintentDpesSubmodule]); init(config); config.setConfig({ @@ -2295,7 +2294,7 @@ describe('User ID', function () { }, { name: 'uid2' },{ - name: 'deepintentId', storage: {name:'deepintentId',type:'cookie'} + name: 'deepintentId', storage: {name: 'deepintentId', type: 'cookie'} }] } }); From b9607c2914d0a48db0d0a3aa0633b0ee590004b1 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Mon, 12 Apr 2021 16:15:43 +0530 Subject: [PATCH 22/23] lint fixes --- test/spec/modules/userId_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/spec/modules/userId_spec.js b/test/spec/modules/userId_spec.js index c5a1443737c..d61d919a5ef 100644 --- a/test/spec/modules/userId_spec.js +++ b/test/spec/modules/userId_spec.js @@ -566,7 +566,7 @@ describe('User ID', function () { }, { name: 'admixerId', storage: {name: 'admixerId', type: 'cookie'} - },{ + }, { name: 'deepintentId', storage: {name: 'deepintentId', type: 'cookie'} }] @@ -2293,7 +2293,7 @@ describe('User ID', function () { name: 'mockId', storage: {name: 'MOCKID', type: 'cookie'} }, { name: 'uid2' - },{ + }, { name: 'deepintentId', storage: {name: 'deepintentId', type: 'cookie'} }] } From cd47115da994cd67035864582309b205557fe48b Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Thu, 15 Apr 2021 08:03:37 +0530 Subject: [PATCH 23/23] code review comments fix --- modules/deepintentDpesIdSystem.js | 8 +------- modules/deepintentDpesIdSystem.md | 5 +++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/deepintentDpesIdSystem.js b/modules/deepintentDpesIdSystem.js index 425b965e57d..375c8c07ed1 100644 --- a/modules/deepintentDpesIdSystem.js +++ b/modules/deepintentDpesIdSystem.js @@ -25,13 +25,7 @@ export const deepintentDpesSubmodule = { * @returns {{deepintentId:Object}} */ decode(value, config) { - if (value) { - return { - 'deepintentId': value - } - } else { - return undefined - } + return value ? { 'deepintentId': value } : undefined; }, /** diff --git a/modules/deepintentDpesIdSystem.md b/modules/deepintentDpesIdSystem.md index 0aa848df11e..2af0fe7446e 100644 --- a/modules/deepintentDpesIdSystem.md +++ b/modules/deepintentDpesIdSystem.md @@ -1,10 +1,11 @@ # Deepintent DPES ID -The Deepintent Id is a shared, healthcare identifier which helps publisher in absence of the 3rd Party cookie matching. This lets publishers set and bid with healthcare identity . Deepintent lets users protect their privacy through advertising value chain, where Healthcare identity when setting the identity takes in consideration of users choices, as well as when passing identity on the cookie itself privacy consent strings are checked. The healthcare identity when set is not stored on Deepintent's servers but is stored on users browsers itself. User can still opt out of the ads by https://option.deepintent.com/adchoices +The Deepintent Id is a shared, healthcare identifier which helps publisher in absence of the 3rd Party cookie matching. This lets publishers set and bid with healthcare identity . Deepintent lets users protect their privacy through advertising value chain, where Healthcare identity when setting the identity takes in consideration of users choices, as well as when passing identity on the cookie itself privacy consent strings are checked. The healthcare identity when set is not stored on Deepintent's servers but is stored on users browsers itself. User can still opt out of the ads by https://option.deepintent.com/adchoices. ## Deepintent DPES ID Registration -The Deepintent DPES ID is free to use, but requires a simple registration with Deepintent. Please contact your sales rep to get started +The Deepintent DPES ID is free to use, but requires a simple registration with Deepintent. Please reach to prebid@deepintent.com to get started. +Once publisher registers with deepintents platform for healthcare identity Deepintent provides the Tag code to be placed on the page, this tag code works to capture and store information as per publishers and users agreement. DPES User ID module uses this stored id and passes it on the deepintent prebid adapter. ## Deepintent DPES ID Configuration