From f98a348b735351cf91428b34dc4794933ee04cdc Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Tue, 19 May 2026 13:15:21 -0400 Subject: [PATCH] Fixes for missing ClientTag value on session log. --- src/layouts/entry-page/entry-page.vue | 2 ++ src/mixins/analytics-mixin.js | 6 ++++++ src/router/index.js | 23 +++++++++++++++++++++++ src/store/index.js | 8 ++++++-- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index 47031709..8b83f988 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -115,6 +115,8 @@ export default { return { isAuthorized: false }; } + this.mainStore.issConfig.clientTag = clientTag; + const resp = await validateISSClientTag(clientTag); if (!resp) { return { isAuthorized: false }; diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index 4312d65c..29165735 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -554,7 +554,13 @@ export default { const sid = getSessionIdValue(); // cookieNames.SESSION_ID // const skey = getSessionKeyValue(); const referrer = applicationConfig.CURRENT_ENVIRONMENT !== 'Localhost' ? document.referrer : null; + const store = useMainStore(); + const clientTag = store.issConfig.clientTag; + const siteType = store.issConfig.siteType; + + const payload = { + clientTag, deviceId, referrer, sessionId: sid, diff --git a/src/router/index.js b/src/router/index.js index abbd9061..f5d4517f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -35,6 +35,19 @@ const routes = [ return await GoToAccessIsDenied(next); } + // This is a quick fix for a prod issue.... better fix will come later. + // This and experiment call for entry-page probably need to be called directly in the mounted + // secion of the entry-page. Can be here for every other page. + if (issPageToUse === issPageValues.ENTRY_PAGE ) + { + const store = useMainStore(); + const queryStringParams = parseQueryParms(to.query); + + if (queryStringParams.clienttag) { + store.issConfig.clientTag = queryStringParams.clienttag; + } + } + await analyticsMixin.methods.validateSession(); // Do not run these for the main entry page - as it is not part of the user flow. @@ -436,6 +449,16 @@ function arePagePrerequisitesValid(component) { return component.default.methods.arePagePrerequisitesValid === undefined || component.default.methods.arePagePrerequisitesValid(); } +// TODO: Put this function some place common. +function parseQueryParms(queryString) { + // Dump the query string parameters into an object + if (queryString) { + return Object.fromEntries(Object.entries(queryString).map(([key, value]) => [key.toLowerCase(), value])); + } + + return {}; +} + // Run SiteEntry and PageEntry triggers for experiments async function runExperiments(nextPage) { const store = useMainStore(); diff --git a/src/store/index.js b/src/store/index.js index 54f97918..ad3c7e40 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -254,6 +254,7 @@ export const getDefaultState = () => ({ clientDisplayName: 'Generic Insurance', // this is the default and will be overridden by the client's name or client display name. clientPossessiveName: 'Generic Insurance\'s', // this is the default and will be overridden by the client's name or client display name converted to possessive or the clients possessive name. clientHeader: {}, + clientTag: '', // ClientTag used by the client to enter the site. styleSheet: '', // Stylesheet used by the client. parentAccountNumber: 0, // Parent account number used by the client. billToAccountNumber: null, @@ -269,7 +270,7 @@ export const getDefaultState = () => ({ policyZipCode: null, dateOfLoss: null }, - siteType: null, + siteType: null, // SiteType / SubType the site is set to (Essential/Advanced). enableNoCompQuote: false } }); @@ -2242,6 +2243,7 @@ export const useMainStore = defineStore({ this.issConfig.clientFullName = 'Generic Insurance'; this.issConfig.clientDisplayName = 'Generic Insurance'; this.issConfig.clientHeader = {}; + this.issConfig.clientTag = ''; this.issConfig.parentAccountNumber = 0; this.issConfig.styleSheet = ''; this.issConfig.isCoverageEnabled = false; @@ -2632,9 +2634,11 @@ export const useMainStore = defineStore({ this.logExperimentIfExists(issPage, experimentUniverses.ISS_FEATURETOGGLE_AREFEES_HIDDEN); this.logExperimentIfExists(issPage, experimentUniverses.ISS_FEATURETOGGLE_AREFEES_OVERRIDDEN); }, - async initializeSession({ userId, sessionId, userAgent, referrer }) { + async initializeSession({ userId, clientTag, siteType, sessionId, userAgent, referrer }) { + //TODO: Add SubType passing ... that is also missing. const payload = { applicationName: applicationConfig.APPLICATION_NAME, + clientTag: clientTag, userId, deviceId: userId, sessionId,