Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/vmuid connectid rebrand #6045

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/userId/eids.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ const USER_IDS_CONFIG = {
atype: 1
},

// Verizon Media
'vmuid': {
// Verizon Media ConnectID
'connectid': {
source: 'verizonmedia.com',
atype: 1
},
Expand Down
11 changes: 6 additions & 5 deletions modules/verizonMediaIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -33,13 +33,14 @@ export const verizonMediaIdSubmodule = {
/**
* decode the stored id value for passing to bid requests
* @function
* @returns {{vmuid: string} | undefined}
* @returns {{connectid: string} | undefined}
*/
decode(value) {
return (value && typeof value.vmuid === 'string') ? {vmuid: value.vmuid} : undefined;
return (typeof value === 'object' && (value.connectid || value.vmuid))
? {connectid: value.connectid || value.vmuid} : undefined;
},
/**
* get the VerizonMedia Id
* Gets the Verizon Media Connect ID
* @function
* @param {SubmoduleConfig} [config]
* @param {ConsentData} [consentData]
Expand Down Expand Up @@ -83,7 +84,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});
};
Expand Down
4 changes: 2 additions & 2 deletions modules/verizonMediaSystemId.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ pbjs.setConfig({
userIds: [{
name: 'verizonMediaId',
storage: {
name: 'vmuid',
name: 'vmcid',
type: 'html5',
expires: 30
expires: 15
},
params: {
pixelId: 58776,
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/aolBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
connectid: SUPPORTED_USER_ID_SOURCES['verizonmedia.com'],
idl_env: SUPPORTED_USER_ID_SOURCES['liveramp.com'],
lipb: {
lipbid: SUPPORTED_USER_ID_SOURCES['liveintent.com'],
Expand Down
34 changes: 28 additions & 6 deletions test/spec/modules/verizonMediaIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,34 @@ describe('Verizon Media ID Submodule', () => {
});

describe('decode()', () => {
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);
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) => {
Expand Down