diff --git a/src/iss-components/continue-modal/continue-modal.vue b/src/iss-components/continue-modal/continue-modal.vue index 062cb86b..8bca85ce 100644 --- a/src/iss-components/continue-modal/continue-modal.vue +++ b/src/iss-components/continue-modal/continue-modal.vue @@ -64,14 +64,11 @@ export default { modalSubHeaderText() { return this.getCmsContent('ContinueReferralModalWidget', 'SubheaderText') .replaceAll('{custom:mmFound}', this.getMakeModelString.toUpperCase()); - }, - accountName() { - return this.mainStore.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp"); } }, methods: { openModal() { - this.pushEventToGA("existing_claim", "pop_up_displayed", this.accountName, true); + this.pushEventToGA("existing_claim", "pop_up_displayed", this.mainStore.accountNameForEvents, true); this.$refs.continueModal.openModal(); }, setModalStatus(isOpened) { @@ -81,11 +78,11 @@ export default { this.$refs.continueModal.closeModal(); }, continueReferral() { - this.pushEventToGA("existing_claim", "finish_claim", this.accountName, true); + this.pushEventToGA("existing_claim", "finish_claim", this.mainStore.accountNameForEvents, true); this.$emit('continue-previous-referral'); }, startNewReferral() { - this.pushEventToGA("existing_claim", "start_new_claim", this.accountName, true); + this.pushEventToGA("existing_claim", "start_new_claim", this.mainStore.accountNameForEvents, true); this.$emit('start-new-referral'); } } diff --git a/src/layouts/welcome-page/welcome-page.vue b/src/layouts/welcome-page/welcome-page.vue index 11584f52..2b80ca23 100644 --- a/src/layouts/welcome-page/welcome-page.vue +++ b/src/layouts/welcome-page/welcome-page.vue @@ -262,7 +262,8 @@ export default { this.pushEventToGA("policy_info", "info_prefilled", isInfoPrefilled.toString(), true); this.$nextTick(() => { - const requiredFieldCount = document.querySelectorAll('[aria-required="true"]').length; + const formRoot = this.$el; + const requiredFieldCount = formRoot.querySelectorAll('[aria-required="true"]').length; this.pushEventToGA("policy_info", "required_fields", requiredFieldCount.toString(), true); }); @@ -279,7 +280,7 @@ export default { this.pushEventToGA("visitor_info_welcome", "referring_site", "ClientSite", null); } - this.pushEventToGA("visitor_info_welcome", "client_name", this.accountName, null); + this.pushEventToGA("visitor_info_welcome", "client_name", this.mainStore.accountNameForEvents, null); }, computed: { DamageCauseOptions() { @@ -329,9 +330,6 @@ export default { }, phoneMask() { return MaskaFormattedMasks.PHONE_NUMBER; - }, - accountName() { - return this.mainStore.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp"); } }, methods: { diff --git a/src/store/index.js b/src/store/index.js index 305ba605..dc5c549f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -445,7 +445,8 @@ export const useMainStore = defineStore({ .map((x) => x.settings) .reduce((r, c) => Object.assign(r, c), {}) ?? {}, originalDeductible: (state) => (state.order.damage.isRepair ? state.order.originalDeductible.repair : state.order.originalDeductible.replace), - currentDeductible: (state) => (state.order.damage.isRepair ? state.order.currentDeductible.repair : state.order.currentDeductible.replace) + currentDeductible: (state) => (state.order.damage.isRepair ? state.order.currentDeductible.repair : state.order.currentDeductible.replace), + accountNameForEvents: (state) => state.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp") }, actions: {