CASH-1918: Mobile First modal data events

This commit is contained in:
Chris Redelinghuys 2026-01-06 09:32:23 -05:00
parent 7b4b93c133
commit e3df448823
2 changed files with 19 additions and 0 deletions

View file

@ -14,6 +14,7 @@ const GaCategories = {
EVOX: "Evox", EVOX: "Evox",
APPOINTMENT: "Appointment", APPOINTMENT: "Appointment",
SERVICE_LOCATION: "service-location", SERVICE_LOCATION: "service-location",
CONFIRMATION_CLICKED: "confirmation clicked",
}; };
const GaActions = { const GaActions = {
@ -26,6 +27,8 @@ const GaActions = {
MOBILE_AVAILABLE: "mobile_available", MOBILE_AVAILABLE: "mobile_available",
SHOPS_FIRST_DISPLAYED: "shops_first_displayed", SHOPS_FIRST_DISPLAYED: "shops_first_displayed",
MORE_LOCATIONS_CLICKED: "more_locations_clicked", MORE_LOCATIONS_CLICKED: "more_locations_clicked",
YES: "yes",
NO: "no",
}; };
const GaLabels = { const GaLabels = {

View file

@ -58,6 +58,7 @@ export default {
timeSlot: null, timeSlot: null,
date: null, date: null,
}, },
confirmedAppointment: false,
}; };
}, },
methods: { methods: {
@ -67,6 +68,7 @@ export default {
this.modal.openModal(); this.modal.openModal();
}, },
onModalClosed() { onModalClosed() {
this.pushEvent();
this.$emit("close-mobile-first-modal"); this.$emit("close-mobile-first-modal");
}, },
closeModal() { closeModal() {
@ -78,6 +80,7 @@ export default {
routeCode: this.selectedAppontment.timeSlot.id, routeCode: this.selectedAppontment.timeSlot.id,
date: this.selectedAppontment.date, date: this.selectedAppontment.date,
}; };
this.confirmedAppointment = true;
this.$emit("confirm-appointment", selectedTimeSlot); this.$emit("confirm-appointment", selectedTimeSlot);
this.modal.closeModal(); this.modal.closeModal();
}, },
@ -90,6 +93,19 @@ export default {
setIsModalOpen(isOpen) { setIsModalOpen(isOpen) {
this.isModalOpen = 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: { computed: {
modalName() { modalName() {