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

Revert "IntentIQ Analytics Module : initial release" #9734

Merged
merged 1 commit into from
Mar 30, 2023
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
241 changes: 0 additions & 241 deletions modules/intentIqAnalyticsAdapter.js

This file was deleted.

19 changes: 0 additions & 19 deletions modules/intentIqAnalyticsAdapter.md

This file was deleted.

48 changes: 1 addition & 47 deletions modules/intentIqIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,11 @@ const PCID_EXPIRY = 365;
const MODULE_NAME = 'intentIqId';
export const FIRST_PARTY_KEY = '_iiq_fdata';
export var FIRST_PARTY_DATA_KEY = '_iiq_fdata';
export var GROUP_LS_KEY = '_iiq_group';
export var WITH_IIQ = 'A';
export var WITHOUT_IIQ = 'B';
export var PRECENT_LS_KEY = '_iiq_precent';
export var DEFAULT_PERCENTAGE = 100;

export const storage = getStorageManager({ gvlid: undefined, moduleName: MODULE_NAME });

const INVALID_ID = 'INVALID_ID';

function getRandom(start, end) {
return Math.floor(Math.random() * (end - start + 1) + start);
}

/**
* Generate standard UUID string
* @return {string}
Expand All @@ -53,9 +44,6 @@ export function readData(key) {
if (storage.hasLocalStorage()) {
return storage.getDataFromLocalStorage(key);
}
if (localStorage) {
return localStorage.getItem(key)
}
if (storage.cookiesAreEnabled()) {
return storage.getCookie(key);
}
Expand All @@ -77,9 +65,6 @@ function storeData(key, value) {
if (value) {
if (storage.hasLocalStorage()) {
storage.setDataInLocalStorage(key, value);
} else
if (localStorage) {
localStorage.setItem(key, value)
}
const expiresStr = (new Date(Date.now() + (PCID_EXPIRY * (60 * 60 * 24 * 1000)))).toUTCString();
if (storage.cookiesAreEnabled()) {
Expand Down Expand Up @@ -118,7 +103,7 @@ export const intentIqIdSubmodule = {
* @param {{string}} value
* @returns {{intentIqId: {string}}|undefined}
*/
decode(value, config) {
decode(value) {
return value && value != '' && INVALID_ID != value ? { 'intentIqId': value } : undefined;
},
/**
Expand All @@ -133,32 +118,6 @@ export const intentIqIdSubmodule = {
logError('User ID - intentIqId submodule requires a valid partner to be defined');
return;
}

if (isNaN(configParams.percentage)) {
logInfo(MODULE_NAME + ' AB Testing percentage is not defined. Setting default value = ' + DEFAULT_PERCENTAGE);
configParams.percentage = DEFAULT_PERCENTAGE;
}

if (isNaN(configParams.percentage) || configParams.percentage < 0 || configParams.percentage > 100) {
logError(MODULE_NAME + 'Percentage - intentIqId submodule requires a valid percentage value');
return false;
}

configParams.group = readData(GROUP_LS_KEY + '_' + configParams.partner);
let percentage = readData(PRECENT_LS_KEY + '_' + configParams.partner);

if (!configParams.group || !percentage || isNaN(percentage) || percentage != configParams.percentage) {
logInfo(MODULE_NAME + 'Generating new Group. Current test group: ' + configParams.group + ', current percentage: ' + percentage + ' , configured percentage: ' + configParams.percentage);
if (configParams.percentage > getRandom(1, 100)) { configParams.group = WITH_IIQ; } else configParams.group = WITHOUT_IIQ;
storeData(GROUP_LS_KEY + '_' + configParams.partner, configParams.group)
storeData(PRECENT_LS_KEY + '_' + configParams.partner, configParams.percentage + '')
logInfo(MODULE_NAME + 'New group: ' + configParams.group)
}
if (configParams.group == WITHOUT_IIQ) {
logInfo(MODULE_NAME + 'Group "B". Passive Mode ON.');
return true;
}

if (!FIRST_PARTY_DATA_KEY.includes(configParams.partner)) { FIRST_PARTY_DATA_KEY += '_' + configParams.partner; }
let rrttStrtTime = 0;

Expand Down Expand Up @@ -198,11 +157,6 @@ export const intentIqIdSubmodule = {
partnerData.cttl = respJson.cttl;
shouldUpdateLs = true;
}

if ('eidl' in respJson) {
partnerData.eidl = respJson.eidl;
}

// If should save and data is empty, means we should save as INVALID_ID
if (respJson.data == '') {
respJson.data = INVALID_ID;
Expand Down
Loading