From de4384a6c3050dee9b63cf82e88b5bf93b4477f1 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Wed, 4 Mar 2026 16:32:27 -0500 Subject: [PATCH] CASH-2378: add GA event changes --- src/constants/analytics.js | 2 ++ .../multi-location-modal.vue | 31 +++++++++++++++++-- src/layouts/schedule/schedule.vue | 11 ++++++- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/constants/analytics.js b/src/constants/analytics.js index e156de11b..51b0c24b6 100644 --- a/src/constants/analytics.js +++ b/src/constants/analytics.js @@ -15,6 +15,8 @@ const GaCategories = { APPOINTMENT: "Appointment", SERVICE_LOCATION: "service-location", CONFIRMATION_CLICKED: "confirmation clicked", + INSHOP_CONFIRMATION_CLICKED: "inshop confirmation clicked", + MOBILE_CONFIRMATION_CLICKED: "mobile confirmation clicked", RECAL_DISCLAIMER: "Recalibration disclaimer", }; diff --git a/src/layouts/schedule/multi-location-modal/multi-location-modal.vue b/src/layouts/schedule/multi-location-modal/multi-location-modal.vue index 3ca0693a8..012e8a15d 100644 --- a/src/layouts/schedule/multi-location-modal/multi-location-modal.vue +++ b/src/layouts/schedule/multi-location-modal/multi-location-modal.vue @@ -80,6 +80,7 @@ export default { confirmedAppointment: false, multiLocationRadioButton: multiLocationRadioButton, selectedValue: null, + experimentSettings: "", }; }, methods: { @@ -122,18 +123,42 @@ export default { setIsModalOpen(isOpen) { this.isModalOpen = isOpen; }, + captureExperimentSettings(settingsString) { + this.experimentSettings = settingsString; + }, pushEvent() { let gaAction = this.confirmedAppointment ? this.GaActions.YES : this.GaActions.NO; - if (this.mobileAppointmentOption && this.mobileAppointmentOption.timeSlot) { + if ( + this.selectedValue?.toLowerCase() === "mobile" && + this.mobileAppointmentOption?.timeSlot + ) { this.pushEventToGA( - this.GaCategories.CONFIRMATION_CLICKED, + this.GaCategories.MOBILE_CONFIRMATION_CLICKED, gaAction, this.mobileAppointmentOption.timeSlot.startTime + "-" + this.mobileAppointmentOption.timeSlot.endTime + " " + this.mobileAppointmentOption.date, - true + true, + null, + this.experimentSettings + ); + } else if ( + this.selectedValue?.toLowerCase() === "inshop" && + this.inshopAppointmentOption?.timeSlot + ) { + this.pushEventToGA( + this.GaCategories.INSHOP_CONFIRMATION_CLICKED, + gaAction, + this.inshopAppointmentOption.timeSlot.startTime + + "-" + + this.inshopAppointmentOption.timeSlot.endTime + + " " + + this.inshopAppointmentOption.date, + true, + null, + this.experimentSettings ); } }, diff --git a/src/layouts/schedule/schedule.vue b/src/layouts/schedule/schedule.vue index e55274d01..f771a2363 100644 --- a/src/layouts/schedule/schedule.vue +++ b/src/layouts/schedule/schedule.vue @@ -2101,7 +2101,15 @@ export default { let showMultiLocationAppointment = experimentMixin.methods.getSettingValue( experimentSettings.SHOW_MULTI_LOCATION_APPT ); - + let experimentSettingsString = + "ShowPm:" + + maxDayRangeToShowPmTimeslot + + "|" + + "NoPm:" + + maxDayRangeToShowNoPmTimeslot + + "|" + + "NoAvail:" + + maxDayRangeToShowAnyTimeslot; let promotedMobileAppointment = null; let promotedInshopAppointment = null; const todaysDate = getTodayDate(); @@ -2228,6 +2236,7 @@ export default { promotedInshopAppointment ); this.$refs.multiLocationModal.openModal(); + this.$refs.multiLocationModal.captureExperimentSettings(experimentSettingsString); } } }