From 83a9dcf63dd9383340a7fac1de7f171a106c834e Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Tue, 9 Apr 2024 16:58:58 -0400 Subject: [PATCH 1/3] push siteType to GA --- src/layouts/entry-page/entry-page.vue | 1 + src/mixins/analytics-mixin.js | 6 ++++++ src/router/index.js | 3 +++ src/store/index.js | 3 ++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index cf029370..8c885a25 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -61,6 +61,7 @@ export default { if (clientTagPresent) { const resp = await validateISSClientTag(clientTag); + this.mainStore.issConfig.siteType = resp.data.siteType; if (resp?.data.active && resp?.data.accountName.length > 0) { if (resp.data.authentication === 'RSAToken') { diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index 137d955a..0d780c81 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -108,6 +108,12 @@ export default { this.logPageView(analyticsPageEvents.ENTRY); }, + pushValueToGA() { + pushToDataLayerIfDefined({ + siteType: useMainStore().issConfig.siteType + }); + }, + pushExperimentsToDataLayer() { const { experiments } = useMainStore().applicationUser; experiments?.forEach((exp) => { diff --git a/src/router/index.js b/src/router/index.js index 294630c2..da2e85b0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -189,6 +189,9 @@ router.afterEach(async (to, from) => { // Push experiments to Data Layer analyticsMixin.methods.pushExperimentsToDataLayer(); + + // Push values to GA + analyticsMixin.methods.pushValueToGA(); } }); diff --git a/src/store/index.js b/src/store/index.js index 2e677807..9932ea9f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -237,7 +237,8 @@ export const getDefaultState = () => ({ policyNumber: null, policyZipCode: null, dateOfLoss: null - } + }, + siteType: null } }); From c577872b6625195d10f32fdacf3621b86545f756 Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Wed, 10 Apr 2024 11:50:12 -0400 Subject: [PATCH 2/3] move saving of siteType to existing method --- src/layouts/entry-page/entry-page.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index 8c885a25..a060ab39 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -61,7 +61,6 @@ export default { if (clientTagPresent) { const resp = await validateISSClientTag(clientTag); - this.mainStore.issConfig.siteType = resp.data.siteType; if (resp?.data.active && resp?.data.accountName.length > 0) { if (resp.data.authentication === 'RSAToken') { @@ -101,6 +100,7 @@ export default { this.mainStore.issConfig.parentAccountNumber = data.parentAccountNumber; this.mainStore.issConfig.styleSheet = data.styleSheet; this.mainStore.issConfig.isCoverageEnabled = data.coverageEnabled; + this.mainStore.issConfig.siteType = data.siteType; try { if (data.clientFlags) { From 3ed91b0c4393a574879f833fd56f6418701d9d08 Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Wed, 10 Apr 2024 12:09:29 -0400 Subject: [PATCH 3/3] add siteType resetting to reset method --- src/store/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/index.js b/src/store/index.js index 9932ea9f..e4e129ec 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1672,6 +1672,7 @@ export const useMainStore = defineStore({ this.issConfig.disabledFields.policyNumber = false; this.issConfig.disabledFields.policyZipCode = false; this.issConfig.disabledFields.dateOfLoss = false; + this.issConfig.siteType = null; }, disableKeyFields() {