diff --git a/src/iss-components/recal-modal/recal-modal.vue b/src/iss-components/recal-modal/recal-modal.vue index 2564c9cf..9563d561 100644 --- a/src/iss-components/recal-modal/recal-modal.vue +++ b/src/iss-components/recal-modal/recal-modal.vue @@ -30,6 +30,7 @@ export default { default: 'RecalModal' } }, + emits: ['recal-modal-opened'], computed: { modalBodyText() { return this.getCmsContent(this.cmsWidgetName, 'BodyText').replaceAll('{custom:vehicleMake}', this.vehicleMake); @@ -50,6 +51,7 @@ export default { methods: { openModal() { this.$refs.recalModal.openModal(); + this.$emit('recal-modal-opened'); }, footerButtonClick() { this.$refs.recalModal.closeModal(); diff --git a/src/layouts/coverage-statement/coverage-statement.spec.js b/src/layouts/coverage-statement/coverage-statement.spec.js index dcccbed6..2e33cf20 100644 --- a/src/layouts/coverage-statement/coverage-statement.spec.js +++ b/src/layouts/coverage-statement/coverage-statement.spec.js @@ -115,7 +115,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.PENDING, @@ -614,7 +615,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.PENDING, @@ -644,7 +646,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.VERIFIED, @@ -673,7 +676,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.VERIFIED, @@ -705,7 +709,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.VERIFIED, @@ -732,7 +737,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.VERIFIED, @@ -763,7 +769,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.VERIFIED, diff --git a/src/layouts/coverage-statement/coverage-statement.vue b/src/layouts/coverage-statement/coverage-statement.vue index 0e2dadc4..88a0ecb7 100644 --- a/src/layouts/coverage-statement/coverage-statement.vue +++ b/src/layouts/coverage-statement/coverage-statement.vue @@ -103,14 +103,16 @@ + cmsWidgetName="RecalModal" + @recalModalOpened="handleRecalModalOpened" /> + cmsWidgetName="OEMEndorsementModal" + @oemEndorsementModalOpened="handleOemEndorsementModalOpened" /> @@ -377,6 +379,71 @@ export default { setupModalLinks(this); }, methods: { + logEventsToGA() { + const clientName = this.mainStore.accountNameForEvents; + + if (this.isDeductibleVisible || this.isITACQuoteVisible) { + this.pushEventToGA('coverage', 'Yes', clientName, true, null, '1'); + if (this.isITACQuoteVisible) { + this.pushEventToGA('Coverage', 'ITAC', `${this.deductibleValue}_${this.totalServicePrice}`, true); + } + else { + this.pushEventToGA('coverage', 'full_comprehensive', clientName, true); + this.pushEventToGA('coverage', 'deductible', this.deductibleValue.toString(), true); + } + } + else { + this.pushEventToGA('coverage', 'No', clientName, true, null, '0'); + if (this.isNoCompQuoteVisible) { + this.pushEventToGA('coverage', 'no_comprehensive', `${this.totalServicePrice}`, true); + this.pushEventToGA('coverage', 'deductible', '9999', true); + } + else { + this.pushEventToGA('coverage', 'deductible', '7777', true); + } + } + + if (this.mainStore.hasOemEndorsement) { + this.pushEventToGA('oem_endorsement', 'displayed', 'Yes', true, null, '1'); + } + else { + this.pushEventToGA('oem_endorsement', 'displayed', 'No', true, null, '0'); + } + + if (this.isADAS) { + if (this.mainStore.vehicle.canSafeliteService) { + this.pushEventToGA('ADAS_self_service', 'ADAS_servicable_status', 'yes', true); + if (this.mainStore.hasRecalibrationPart) { + if (this.isDeductibleVisible) { + const recalibrationType = this.mainStore.lineItems.glassParts.find((part) => part.requiresRecalibration).recalibrationType; + if (this.deductibleValue <= 0) { + this.pushEventToGA('recalibration_opportunity_verified_0_deductible', this.mainStore.vehicle.carId, `recal_type_${recalibrationType}`, true); + } + else { + this.pushEventToGA('recalibration_opportunity_verified_over_0_deductible', this.mainStore.vehicle.carId, `recal_type_${recalibrationType}`, true); + } + } + else { + let appointmentType = ''; + if (this.isITACQuoteVisible) { + appointmentType = 'ITAC'; + } + else if (this.isNoCompQuoteVisible) { + appointmentType = 'no_comp'; + } + else { + appointmentType = 'unverified'; + } + this.pushEventToGA(`recalibration_opportunity_${appointmentType}`, this.mainStore.vehicle.carId, `recal_type_${this.mainStore.lineItems.glassParts.find((part) => part.requiresRecalibration).recalibrationType}`, true); + } + } + } + else { + this.pushEventToGA('ADAS_self_service', 'ADAS_servicable_status', 'no', true); + } + } + }, + arePagePrerequisitesValid() { return !!useMainStore().vehicle.carId; }, @@ -396,6 +463,8 @@ export default { } } + this.logEventsToGA(); + showIssLoadingModal(false); this.isPageLoading = false; }, @@ -414,7 +483,13 @@ export default { }, async navigateForward() { showIssLoadingModal(true); - if (this.isUnverifiedVisible || this.isDeductibleVisible) { + if (this.isUnverifiedVisible || this.isDeductibleVisible) { + if (this.isRepair) { + this.pushEventToGA('RepairDamage', 'Repair', this.mainStore.damage.numberOfChips.toString(), true, null, '1'); + } + else { + this.pushEventToGA('RepairDamage', 'Replacement', 'Replacement', true, null, '1'); + } this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD); } else if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) { this.mainStore.updateIsSafeliteProvider(true); @@ -478,7 +553,13 @@ export default { cancelClaim() { this.mainStore.updateIsSafeliteProvider(false); this.$router.navigateBailout(bailoutMessage.CoverageCancelledByUser()); - } + }, + handleRecalModalOpened() { + this.pushEventToGA('recalibration_modal', 'learn_more_clicked', this.mainStore.vehicle.carId, true); + }, + handleOemEndorsementModalOpened() { + this.pushEventToGA('oem_endorsement_modal', 'clicked', 'Yes', true, null, '1'); + }, } }; diff --git a/src/layouts/coverage-statement/oem-endorsement-modal/oem-endorsement-modal.vue b/src/layouts/coverage-statement/oem-endorsement-modal/oem-endorsement-modal.vue index 85ee726b..6daff222 100644 --- a/src/layouts/coverage-statement/oem-endorsement-modal/oem-endorsement-modal.vue +++ b/src/layouts/coverage-statement/oem-endorsement-modal/oem-endorsement-modal.vue @@ -26,6 +26,7 @@ export default { default: 'OEMEndorsementModal' } }, + emits: ['oem-endorsement-modal-opened'], computed: { modalBodyText() { return this.getCmsContent(this.cmsWidgetName, 'BodyText'); @@ -40,6 +41,7 @@ export default { methods: { openModal() { this.$refs.oemEndorsementModal.openModal(); + this.$emit('oem-endorsement-modal-opened'); }, footerButtonClick() { this.$refs.oemEndorsementModal.closeModal(); diff --git a/src/layouts/order-confirmation/order-confirmation.vue b/src/layouts/order-confirmation/order-confirmation.vue index d533f276..21ce4fc7 100644 --- a/src/layouts/order-confirmation/order-confirmation.vue +++ b/src/layouts/order-confirmation/order-confirmation.vue @@ -193,7 +193,7 @@ export default { appointmentType: serviceLocation.appointmentType, providerAddress: serviceLocation?.provider?.address, customerPortalLoginToken, - carrierName: issConfig.clientName, + carrierName: issConfig.clientDisplayName, carrierUrl: issConfig.successReturnURL, isRepair: damage.isRepair, hasRecalibrationPart,