From 9a7b452b9827f33fb46d5e13850e136de530688d Mon Sep 17 00:00:00 2001 From: Alex Humphries Date: Tue, 21 Apr 2026 16:53:34 -0400 Subject: [PATCH] INSR-8884: More payment-method events --- .../payment-method-question.vue | 2 + src/layouts/payment-method/payment-method.vue | 37 ++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/layouts/payment-method/payment-method-question/payment-method-question.vue b/src/layouts/payment-method/payment-method-question/payment-method-question.vue index 33d82adf..38919f7b 100644 --- a/src/layouts/payment-method/payment-method-question/payment-method-question.vue +++ b/src/layouts/payment-method/payment-method-question/payment-method-question.vue @@ -20,6 +20,7 @@ import buttonQuestion from '@/digital-components/button-question/button-question import widgetFields from '@/constants/cms-widget-fields.js'; import paymentMethodListButton from './payment-method-list-button/payment-method-list-button.vue'; import { markRaw } from 'vue'; +import { analyticsPaymentTypeMap } from '@/constants/analytics'; export default { name: 'payment-method-question', @@ -43,6 +44,7 @@ export default { return this.modelValue; }, set(selectedMethod) { + this.pushEventToGA('submit_order', 'payment_type_selected', analyticsPaymentTypeMap.get(selectedMethod), true); this.$emit('update:modelValue', selectedMethod); } }, diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index af37a518..b4599eb5 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -157,6 +157,7 @@ import { formatAmountInDollars } from '@/helpers/text-helper'; import widgetFields from '@/constants/cms-widget-fields'; import MaskaFormattedMasks from '@/constants/maska-masks'; import { containsRecalParts } from '@/helpers/recal-helper'; +import coverageType from '@/constants/coverage-type'; export default { name: 'payment-method', @@ -199,7 +200,7 @@ export default { }); }, mounted() { - this.handleAnalyticsEvents(); + this.handleAnalyticsEventsOnMounted(); }, data() { return { @@ -415,6 +416,7 @@ export default { this.$refs.siteFooter.updateButtonText(newValue); }, async forwardButtonAction() { + this.handleAnalyticsEventsOnForwardButtonAction(); this.mainStore.savePaymentMethodChoice(this.paymentMethod); this.savePageDataToStore(issPageValues.PAYMENT_METHOD, { smsOptIn: this.smsOptIn }); if (!this.hideSMSOptIn) { @@ -464,6 +466,7 @@ export default { handleEditClicked(section) { switch (section) { case 'location': + this.pushEventToGA('order_summary', 'change', 'location', true); const scenario = this.mainStore.isMobileAppointment ? this.navigationScenarios.EDIT_SERVICE_LOCATION_MOBILE : this.navigationScenarios.EDIT_SERVICE_LOCATION_INSHOP; @@ -473,6 +476,7 @@ export default { ); break; case 'schedule': + this.pushEventToGA('order_summary', 'change', 'time', true); this.$router.navigateWithSpinner( this.navigationScenarios.EDIT_SCHEDULE, this.$route @@ -504,7 +508,7 @@ export default { closeContactDetailsWithoutSaving() { this.smsOptIn = 'No'; }, - handleAnalyticsEvents() { + handleAnalyticsEventsOnMounted() { const mobileOrInshop = this.mainStore.isMobileAppointment ? 'mobile' : 'in_shop'; const verifiedOrNotVerified = this.mainStore.isVerified ? 'verified' : 'not_verified'; const repairOrReplace = this.mainStore.isRepair ? 'repair' : 'replace'; @@ -524,6 +528,35 @@ export default { const recalibrationType = this.mainStore.lineItems.glassParts?.find((part) => part.requiresRecalibration)?.recalibrationType; this.pushEventToGA(`recalibration_added_${coverageType}`, this.mainStore.vehicle.carId, `recal_type_${recalibrationType}`.replace(/ /g, '_').toLowerCase(), true); } + + const hasFrontWiper = this.mainStore.lineItems.vaps.some((part) => part.partType === partTypeStrings.FRONT_WIPER); + const hasRearWiper = this.mainStore.lineItems.vaps.some((part) => part.partType === partTypeStrings.REAR_WIPER); + const wiperEventLabel = `front_${hasFrontWiper ? 'advanced' : 'none'}_rear_${hasRearWiper ? 'advanced' : 'none'}`; + this.pushEventToGA('wipers', 'attached_to_order', wiperEventLabel, true); + }, + handleAnalyticsEventsOnForwardButtonAction() { + this.pushEventToGA('order_summary', 'edit', 'contact_details', true); + let action; + let label; + switch (this.mainStore.coverageType) { + case coverageType.Deductible: + action = 'Covered'; + label = this.mainStore.currentDeductible; + break; + case coverageType.ITAC: + action = 'ITAC'; + label = this.mainStore.currentDeductible + "_" + getCartTotal(this.mainStore.order); + break; + case coverageType.NO_COMP: + action = 'NOCOMP'; + label = 'Unverified'; + break; + case coverageType.NONE: + action = 'Unverified'; + label = 'Unverified'; + break; + } + this.pushEventToGA('Submit Appointment', action, label, true, null, 1); } } };