Skip to content

Commit

Permalink
Revert "IntentIQ Analytics Module : initial release (prebid#9322)" (p…
Browse files Browse the repository at this point in the history
…rebid#9734)

This reverts commit 67184b0.
  • Loading branch information
ChrisHuie authored and jorgeluisrocha committed May 18, 2023
1 parent c7fa10d commit da26ccf
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 573 deletions.
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

0 comments on commit da26ccf

Please sign in to comment.