Merge pull request #3082 from Safelite/feature/CASH-2378

CASH-2378: add GA event changes
This commit is contained in:
AdamCaouetteSafelite 2026-03-05 08:32:12 -05:00 committed by GitHub
commit 6a20516637
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 42 additions and 4 deletions

View file

@ -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",
};

View file

@ -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
);
}
},

View file

@ -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,9 @@ export default {
promotedInshopAppointment
);
this.$refs.multiLocationModal.openModal();
this.$refs.multiLocationModal.captureExperimentSettings(
experimentSettingsString
);
}
}
}