From 2712426a2f756740c3253c0fc25b948dd1c89338 Mon Sep 17 00:00:00 2001 From: slimkrazy Date: Wed, 11 Nov 2020 16:23:49 +0000 Subject: [PATCH 1/3] Key name change from vmuid to vmcid --- modules/userId/eids.js | 4 ++-- modules/verizonMediaIdSystem.js | 8 ++++---- modules/verizonMediaSystemId.md | 4 ++-- test/spec/modules/aolBidAdapter_spec.js | 2 +- test/spec/modules/verizonMediaIdSystem_spec.js | 7 ++++--- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/userId/eids.js b/modules/userId/eids.js index 8118607fbde..820993e7bb1 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -158,8 +158,8 @@ const USER_IDS_CONFIG = { atype: 1 }, - // Verizon Media - 'vmuid': { + // Verizon Media ConnectID + 'vmcid': { source: 'verizonmedia.com', atype: 1 } diff --git a/modules/verizonMediaIdSystem.js b/modules/verizonMediaIdSystem.js index 617561765cc..d0c8424157d 100644 --- a/modules/verizonMediaIdSystem.js +++ b/modules/verizonMediaIdSystem.js @@ -12,7 +12,7 @@ import * as utils from '../src/utils.js'; const MODULE_NAME = 'verizonMediaId'; const VENDOR_ID = 25; const PLACEHOLDER = '__PIXEL_ID__'; -const VMUID_ENDPOINT = `https://ups.analytics.yahoo.com/ups/${PLACEHOLDER}/fed`; +const VMCID_ENDPOINT = `https://ups.analytics.yahoo.com/ups/${PLACEHOLDER}/fed`; function isEUConsentRequired(consentData) { return !!(consentData && consentData.gdpr && consentData.gdpr.gdprApplies); @@ -33,10 +33,10 @@ export const verizonMediaIdSubmodule = { /** * decode the stored id value for passing to bid requests * @function - * @returns {{vmuid: string} | undefined} + * @returns {{vmcid: string} | undefined} */ decode(value) { - return (value && typeof value.vmuid === 'string') ? {vmuid: value.vmuid} : undefined; + return (value && typeof value.vmuid === 'string') ? {vmcid: value.vmuid} : undefined; }, /** * get the VerizonMedia Id @@ -83,7 +83,7 @@ export const verizonMediaIdSubmodule = { callback(); } }; - const endpoint = VMUID_ENDPOINT.replace(PLACEHOLDER, params.pixelId); + const endpoint = VMCID_ENDPOINT.replace(PLACEHOLDER, params.pixelId); let url = `${params.endpoint || endpoint}?${utils.formatQS(data)}`; verizonMediaIdSubmodule.getAjaxFn()(url, callbacks, null, {method: 'GET', withCredentials: true}); }; diff --git a/modules/verizonMediaSystemId.md b/modules/verizonMediaSystemId.md index 8d0e0bddaa9..c0d315dc754 100644 --- a/modules/verizonMediaSystemId.md +++ b/modules/verizonMediaSystemId.md @@ -10,9 +10,9 @@ pbjs.setConfig({ userIds: [{ name: 'verizonMediaId', storage: { - name: 'vmuid', + name: 'vmcid', type: 'html5', - expires: 30 + expires: 15 }, params: { pixelId: 58776, diff --git a/test/spec/modules/aolBidAdapter_spec.js b/test/spec/modules/aolBidAdapter_spec.js index 11e1a317b70..20fa6125d46 100644 --- a/test/spec/modules/aolBidAdapter_spec.js +++ b/test/spec/modules/aolBidAdapter_spec.js @@ -93,7 +93,7 @@ describe('AolAdapter', function () { const USER_ID_DATA = { criteoId: SUPPORTED_USER_ID_SOURCES['criteo.com'], - vmuid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'], + vmcid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'], idl_env: SUPPORTED_USER_ID_SOURCES['liveramp.com'], lipb: { lipbid: SUPPORTED_USER_ID_SOURCES['liveintent.com'], diff --git a/test/spec/modules/verizonMediaIdSystem_spec.js b/test/spec/modules/verizonMediaIdSystem_spec.js index a30be5a2569..81f4ba1dbad 100644 --- a/test/spec/modules/verizonMediaIdSystem_spec.js +++ b/test/spec/modules/verizonMediaIdSystem_spec.js @@ -168,9 +168,10 @@ describe('Verizon Media ID Submodule', () => { const VALID_API_RESPONSE = { vmuid: '1234' }; - it('should return a newly constructed object with the vmuid property', () => { - expect(verizonMediaIdSubmodule.decode(VALID_API_RESPONSE)).to.deep.equal(VALID_API_RESPONSE); - expect(verizonMediaIdSubmodule.decode(VALID_API_RESPONSE)).to.not.equal(VALID_API_RESPONSE); + it('should return a newly constructed object with the vcuid property', () => { + expect(verizonMediaIdSubmodule.decode(VALID_API_RESPONSE)).to.deep.equal( + {vmcid: VALID_API_RESPONSE.vmuid} + ); }); [{}, '', {foo: 'bar'}].forEach((response) => { From 12797b995303fa3bc87bb11c834421dbd536bbbf Mon Sep 17 00:00:00 2001 From: slimkrazy Date: Sun, 29 Nov 2020 14:25:42 +0000 Subject: [PATCH 2/3] Change the userId key name to vmconnectid --- modules/userId/eids.js | 2 +- modules/verizonMediaIdSystem.js | 6 +++--- test/spec/modules/aolBidAdapter_spec.js | 2 +- test/spec/modules/verizonMediaIdSystem_spec.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/userId/eids.js b/modules/userId/eids.js index 820993e7bb1..a453bcc2bad 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -159,7 +159,7 @@ const USER_IDS_CONFIG = { }, // Verizon Media ConnectID - 'vmcid': { + 'vmconnectid': { source: 'verizonmedia.com', atype: 1 } diff --git a/modules/verizonMediaIdSystem.js b/modules/verizonMediaIdSystem.js index d0c8424157d..22929fa99e3 100644 --- a/modules/verizonMediaIdSystem.js +++ b/modules/verizonMediaIdSystem.js @@ -33,13 +33,13 @@ export const verizonMediaIdSubmodule = { /** * decode the stored id value for passing to bid requests * @function - * @returns {{vmcid: string} | undefined} + * @returns {{vmconnectid: string} | undefined} */ decode(value) { - return (value && typeof value.vmuid === 'string') ? {vmcid: value.vmuid} : undefined; + return (value && typeof value.vmuid === 'string') ? {vmconnectid: value.vmuid} : undefined; }, /** - * get the VerizonMedia Id + * Gets the Verizon Media Connect ID * @function * @param {SubmoduleConfig} [config] * @param {ConsentData} [consentData] diff --git a/test/spec/modules/aolBidAdapter_spec.js b/test/spec/modules/aolBidAdapter_spec.js index 20fa6125d46..2fc7e382e0d 100644 --- a/test/spec/modules/aolBidAdapter_spec.js +++ b/test/spec/modules/aolBidAdapter_spec.js @@ -93,7 +93,7 @@ describe('AolAdapter', function () { const USER_ID_DATA = { criteoId: SUPPORTED_USER_ID_SOURCES['criteo.com'], - vmcid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'], + vmconnectid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'], idl_env: SUPPORTED_USER_ID_SOURCES['liveramp.com'], lipb: { lipbid: SUPPORTED_USER_ID_SOURCES['liveintent.com'], diff --git a/test/spec/modules/verizonMediaIdSystem_spec.js b/test/spec/modules/verizonMediaIdSystem_spec.js index 81f4ba1dbad..6ea1d7aba28 100644 --- a/test/spec/modules/verizonMediaIdSystem_spec.js +++ b/test/spec/modules/verizonMediaIdSystem_spec.js @@ -168,9 +168,9 @@ describe('Verizon Media ID Submodule', () => { const VALID_API_RESPONSE = { vmuid: '1234' }; - it('should return a newly constructed object with the vcuid property', () => { + it('should return a newly constructed object with the vmconnectid property', () => { expect(verizonMediaIdSubmodule.decode(VALID_API_RESPONSE)).to.deep.equal( - {vmcid: VALID_API_RESPONSE.vmuid} + {vmconnectid: VALID_API_RESPONSE.vmuid} ); }); From 0a0e139ed91a8a1b974f186e97746897379ca6b7 Mon Sep 17 00:00:00 2001 From: slimkrazy Date: Fri, 4 Dec 2020 11:48:39 +0000 Subject: [PATCH 3/3] Support new key in response payload + remain backward compatible. --- modules/userId/eids.js | 2 +- modules/verizonMediaIdSystem.js | 5 +-- test/spec/modules/aolBidAdapter_spec.js | 2 +- .../spec/modules/verizonMediaIdSystem_spec.js | 35 +++++++++++++++---- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/modules/userId/eids.js b/modules/userId/eids.js index dea8f352e7a..d714d09962d 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -159,7 +159,7 @@ const USER_IDS_CONFIG = { }, // Verizon Media ConnectID - 'vmconnectid': { + 'connectid': { source: 'verizonmedia.com', atype: 1 }, diff --git a/modules/verizonMediaIdSystem.js b/modules/verizonMediaIdSystem.js index 22929fa99e3..f39909f6666 100644 --- a/modules/verizonMediaIdSystem.js +++ b/modules/verizonMediaIdSystem.js @@ -33,10 +33,11 @@ export const verizonMediaIdSubmodule = { /** * decode the stored id value for passing to bid requests * @function - * @returns {{vmconnectid: string} | undefined} + * @returns {{connectid: string} | undefined} */ decode(value) { - return (value && typeof value.vmuid === 'string') ? {vmconnectid: value.vmuid} : undefined; + return (typeof value === 'object' && (value.connectid || value.vmuid)) + ? {connectid: value.connectid || value.vmuid} : undefined; }, /** * Gets the Verizon Media Connect ID diff --git a/test/spec/modules/aolBidAdapter_spec.js b/test/spec/modules/aolBidAdapter_spec.js index 2fc7e382e0d..8e74e19f420 100644 --- a/test/spec/modules/aolBidAdapter_spec.js +++ b/test/spec/modules/aolBidAdapter_spec.js @@ -93,7 +93,7 @@ describe('AolAdapter', function () { const USER_ID_DATA = { criteoId: SUPPORTED_USER_ID_SOURCES['criteo.com'], - vmconnectid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'], + connectid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'], idl_env: SUPPORTED_USER_ID_SOURCES['liveramp.com'], lipb: { lipbid: SUPPORTED_USER_ID_SOURCES['liveintent.com'], diff --git a/test/spec/modules/verizonMediaIdSystem_spec.js b/test/spec/modules/verizonMediaIdSystem_spec.js index 6ea1d7aba28..c5d743235d6 100644 --- a/test/spec/modules/verizonMediaIdSystem_spec.js +++ b/test/spec/modules/verizonMediaIdSystem_spec.js @@ -165,13 +165,34 @@ describe('Verizon Media ID Submodule', () => { }); describe('decode()', () => { - const VALID_API_RESPONSE = { - vmuid: '1234' - }; - it('should return a newly constructed object with the vmconnectid property', () => { - expect(verizonMediaIdSubmodule.decode(VALID_API_RESPONSE)).to.deep.equal( - {vmconnectid: VALID_API_RESPONSE.vmuid} - ); + const VALID_API_RESPONSES = [{ + key: 'vmiud', + expected: '1234', + payload: { + vmuid: '1234' + } + }, + { + key: 'connectid', + expected: '4567', + payload: { + connectid: '4567' + } + }, + { + key: 'both', + expected: '4567', + payload: { + vmuid: '1234', + connectid: '4567' + } + }]; + VALID_API_RESPONSES.forEach(responseData => { + it('should return a newly constructed object with the connectid for a payload with ${responseData.key} key(s)', () => { + expect(verizonMediaIdSubmodule.decode(responseData.payload)).to.deep.equal( + {connectid: responseData.expected} + ); + }); }); [{}, '', {foo: 'bar'}].forEach((response) => {