From e3df44882343c81496599998346f7d6e2bbb7d5c Mon Sep 17 00:00:00 2001 From: Chris Redelinghuys Date: Tue, 6 Jan 2026 09:32:23 -0500 Subject: [PATCH] CASH-1918: Mobile First modal data events --- src/constants/analytics.js | 3 +++ .../mobile-first-modal/mobile-first-modal.vue | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/constants/analytics.js b/src/constants/analytics.js index fe43be06d..00088baa7 100644 --- a/src/constants/analytics.js +++ b/src/constants/analytics.js @@ -14,6 +14,7 @@ const GaCategories = { EVOX: "Evox", APPOINTMENT: "Appointment", SERVICE_LOCATION: "service-location", + CONFIRMATION_CLICKED: "confirmation clicked", }; const GaActions = { @@ -26,6 +27,8 @@ const GaActions = { MOBILE_AVAILABLE: "mobile_available", SHOPS_FIRST_DISPLAYED: "shops_first_displayed", MORE_LOCATIONS_CLICKED: "more_locations_clicked", + YES: "yes", + NO: "no", }; const GaLabels = { diff --git a/src/layouts/schedule/mobile-first-modal/mobile-first-modal.vue b/src/layouts/schedule/mobile-first-modal/mobile-first-modal.vue index 1ef9fbc54..ee235de7c 100644 --- a/src/layouts/schedule/mobile-first-modal/mobile-first-modal.vue +++ b/src/layouts/schedule/mobile-first-modal/mobile-first-modal.vue @@ -58,6 +58,7 @@ export default { timeSlot: null, date: null, }, + confirmedAppointment: false, }; }, methods: { @@ -67,6 +68,7 @@ export default { this.modal.openModal(); }, onModalClosed() { + this.pushEvent(); this.$emit("close-mobile-first-modal"); }, closeModal() { @@ -78,6 +80,7 @@ export default { routeCode: this.selectedAppontment.timeSlot.id, date: this.selectedAppontment.date, }; + this.confirmedAppointment = true; this.$emit("confirm-appointment", selectedTimeSlot); this.modal.closeModal(); }, @@ -90,6 +93,19 @@ export default { setIsModalOpen(isOpen) { this.isModalOpen = isOpen; }, + pushEvent() { + let gaAction = this.confirmedAppointment ? this.GaActions.YES : this.GaActions.NO; + this.pushEventToGA( + this.GaCategories.CONFIRMATION_CLICKED, + gaAction, + this.selectedAppontment.timeSlot.startTime + + "-" + + this.selectedAppontment.timeSlot.endTime + + " " + + this.selectedAppontment.date, + true + ); + }, }, computed: { modalName() {