CASH-2378: add GA event changes
This commit is contained in:
parent
1f2c22dfc8
commit
de4384a6c3
3 changed files with 40 additions and 4 deletions
|
|
@ -15,6 +15,8 @@ const GaCategories = {
|
||||||
APPOINTMENT: "Appointment",
|
APPOINTMENT: "Appointment",
|
||||||
SERVICE_LOCATION: "service-location",
|
SERVICE_LOCATION: "service-location",
|
||||||
CONFIRMATION_CLICKED: "confirmation clicked",
|
CONFIRMATION_CLICKED: "confirmation clicked",
|
||||||
|
INSHOP_CONFIRMATION_CLICKED: "inshop confirmation clicked",
|
||||||
|
MOBILE_CONFIRMATION_CLICKED: "mobile confirmation clicked",
|
||||||
RECAL_DISCLAIMER: "Recalibration disclaimer",
|
RECAL_DISCLAIMER: "Recalibration disclaimer",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@ export default {
|
||||||
confirmedAppointment: false,
|
confirmedAppointment: false,
|
||||||
multiLocationRadioButton: multiLocationRadioButton,
|
multiLocationRadioButton: multiLocationRadioButton,
|
||||||
selectedValue: null,
|
selectedValue: null,
|
||||||
|
experimentSettings: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -122,18 +123,42 @@ export default {
|
||||||
setIsModalOpen(isOpen) {
|
setIsModalOpen(isOpen) {
|
||||||
this.isModalOpen = isOpen;
|
this.isModalOpen = isOpen;
|
||||||
},
|
},
|
||||||
|
captureExperimentSettings(settingsString) {
|
||||||
|
this.experimentSettings = settingsString;
|
||||||
|
},
|
||||||
pushEvent() {
|
pushEvent() {
|
||||||
let gaAction = this.confirmedAppointment ? this.GaActions.YES : this.GaActions.NO;
|
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.pushEventToGA(
|
||||||
this.GaCategories.CONFIRMATION_CLICKED,
|
this.GaCategories.MOBILE_CONFIRMATION_CLICKED,
|
||||||
gaAction,
|
gaAction,
|
||||||
this.mobileAppointmentOption.timeSlot.startTime +
|
this.mobileAppointmentOption.timeSlot.startTime +
|
||||||
"-" +
|
"-" +
|
||||||
this.mobileAppointmentOption.timeSlot.endTime +
|
this.mobileAppointmentOption.timeSlot.endTime +
|
||||||
" " +
|
" " +
|
||||||
this.mobileAppointmentOption.date,
|
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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2101,7 +2101,15 @@ export default {
|
||||||
let showMultiLocationAppointment = experimentMixin.methods.getSettingValue(
|
let showMultiLocationAppointment = experimentMixin.methods.getSettingValue(
|
||||||
experimentSettings.SHOW_MULTI_LOCATION_APPT
|
experimentSettings.SHOW_MULTI_LOCATION_APPT
|
||||||
);
|
);
|
||||||
|
let experimentSettingsString =
|
||||||
|
"ShowPm:" +
|
||||||
|
maxDayRangeToShowPmTimeslot +
|
||||||
|
"|" +
|
||||||
|
"NoPm:" +
|
||||||
|
maxDayRangeToShowNoPmTimeslot +
|
||||||
|
"|" +
|
||||||
|
"NoAvail:" +
|
||||||
|
maxDayRangeToShowAnyTimeslot;
|
||||||
let promotedMobileAppointment = null;
|
let promotedMobileAppointment = null;
|
||||||
let promotedInshopAppointment = null;
|
let promotedInshopAppointment = null;
|
||||||
const todaysDate = getTodayDate();
|
const todaysDate = getTodayDate();
|
||||||
|
|
@ -2228,6 +2236,7 @@ export default {
|
||||||
promotedInshopAppointment
|
promotedInshopAppointment
|
||||||
);
|
);
|
||||||
this.$refs.multiLocationModal.openModal();
|
this.$refs.multiLocationModal.openModal();
|
||||||
|
this.$refs.multiLocationModal.captureExperimentSettings(experimentSettingsString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue