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

IntentIQ Analytics Adapter: fix fpid issue #12254

Merged
merged 3 commits into from
Sep 19, 2024
Merged
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
12 changes: 7 additions & 5 deletions modules/intentIqAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ function readData(key) {

function initLsValues() {
if (iiqAnalyticsAnalyticsAdapter.initOptions.lsValueInitialized) return;
iiqAnalyticsAnalyticsAdapter.initOptions.fpid = JSON.parse(readData(FIRST_PARTY_KEY));
let iiqArr = config.getConfig('userSync.userIds').filter(m => m.name == 'intentIqId');
if (iiqArr && iiqArr.length > 0) iiqAnalyticsAnalyticsAdapter.initOptions.lsValueInitialized = true;
if (!iiqArr) iiqArr = [];
Expand All @@ -112,18 +111,19 @@ function initLsValues() {
if (iiqArr && iiqArr.length > 0) {
if (iiqArr[0].params && iiqArr[0].params.partner && !isNaN(iiqArr[0].params.partner)) {
iiqAnalyticsAnalyticsAdapter.initOptions.partner = iiqArr[0].params.partner;
iiqAnalyticsAnalyticsAdapter.initOptions.currentGroup = iiqAnalyticsAnalyticsAdapter.initOptions.fpid.group;
}

iiqAnalyticsAnalyticsAdapter.initOptions.browserBlackList = typeof iiqArr[0].params.browserBlackList === 'string' ? iiqArr[0].params.browserBlackList.toLowerCase() : '';
}
}

function initReadLsIds() {
if (isNaN(iiqAnalyticsAnalyticsAdapter.initOptions.partner) || iiqAnalyticsAnalyticsAdapter.initOptions.partner == -1) return;
try {
iiqAnalyticsAnalyticsAdapter.initOptions.dataInLs = null;
let iData = readData(FIRST_PARTY_DATA_KEY + '_' + iiqAnalyticsAnalyticsAdapter.initOptions.partner)
iiqAnalyticsAnalyticsAdapter.initOptions.fpid = JSON.parse(readData(FIRST_PARTY_KEY));
if (iiqAnalyticsAnalyticsAdapter.initOptions.fpid) {
iiqAnalyticsAnalyticsAdapter.initOptions.currentGroup = iiqAnalyticsAnalyticsAdapter.initOptions.fpid.group;
}
let iData = readData(FIRST_PARTY_DATA_KEY + '_' + iiqAnalyticsAnalyticsAdapter.initOptions.partner);
if (iData) {
iiqAnalyticsAnalyticsAdapter.initOptions.lsIdsInitialized = true;
let pData = JSON.parse(iData);
Expand All @@ -138,6 +138,8 @@ function initReadLsIds() {
function bidWon(args) {
if (!iiqAnalyticsAnalyticsAdapter.initOptions.lsValueInitialized) { initLsValues(); }

if (isNaN(iiqAnalyticsAnalyticsAdapter.initOptions.partner) || iiqAnalyticsAnalyticsAdapter.initOptions.partner == -1) return;

const currentBrowserLowerCase = detectBrowser();
if (iiqAnalyticsAnalyticsAdapter.initOptions.browserBlackList?.includes(currentBrowserLowerCase)) {
logError('IIQ ANALYTICS -> Browser is in blacklist!');
Expand Down