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 a8b77aa5..5158139e 100644 --- a/src/layouts/coverage-statement/coverage-statement.spec.js +++ b/src/layouts/coverage-statement/coverage-statement.spec.js @@ -109,7 +109,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.PENDING, @@ -606,7 +607,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.PENDING, @@ -636,7 +638,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.VERIFIED, @@ -665,7 +668,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.VERIFIED, @@ -697,7 +701,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.VERIFIED, @@ -724,7 +729,8 @@ describe('coverageStatement.vue', () => { const mainInitialState = { order: { damage: { - isRepair: true + isRepair: true, + numberOfChips: 2 }, insuranceCoverage: { coverageStatus: coverageStatuses.VERIFIED, @@ -755,7 +761,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 e47fa1fa..d70dca87 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" /> @@ -374,6 +376,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; }, @@ -393,6 +460,8 @@ export default { } } + this.logEventsToGA(); + showIssLoadingModal(false); this.isPageLoading = false; }, @@ -410,8 +479,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); @@ -475,7 +549,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, diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index cfe48753..74bf65c1 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -96,6 +96,8 @@ export default { const currentPageName = this.getPageNameByQueryString(); const labelToLog = getValueToLog(label, valueToLogType); + console.log(`Pushing event to GA: category=${category}, action=${action}, label=${labelToLog}, value=${value}, page=${currentPageName}`); + const eventToBePushed = { event: GaEvents.GENERIC_EVENT, category,