ga event defect

This commit is contained in:
Donielle Austin 2022-05-18 08:43:06 -04:00
parent 1c4d609959
commit b1e14f80df
4 changed files with 17 additions and 15 deletions

View file

@ -153,16 +153,15 @@ export default {
);
},
attachCustomEvents() {
this.prependActionToMethod(this, this.forwardButtonAction, this.logGAEventForVin());
},
logGAEventForVin(){
this.prependActionToMethod(this, this.forwardButtonAction, () => {
this.pushEventToGA(
this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.SUBMITTED,
this.GaLabels.ADDRESS_LOOKUP,
true
);
},
);
});
},
getRegistrationAddressFromStore() {
return store.getters.vehicle.registration.address;
},

View file

@ -187,15 +187,14 @@ export default {
store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES);
},
attachCustomEvents() {
this.prependActionToMethod(this, this.forwardButtonAction, this.logGAEventForVin());
},
logGAEventForVin(){
this.prependActionToMethod(this, this.forwardButtonAction, () => {
this.pushEventToGA(
this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.SUBMITTED,
this.GaLabels.LICENSE_PLATE_LOOKUP,
true
);
);
});
},
getLicensePlateFromStore() {
return store.getters.vehicle.registration.licensePlate;

View file

@ -259,15 +259,14 @@ export default {
return store.getters.order.serviceLocation.zipCode;
},
attachCustomEvents() {
this.prependActionToMethod(this, this.forwardButtonAction, this.logGAEventForVin());
},
logGAEventForVin(){
this.pushEventToGA(
this.prependActionToMethod(this, this.forwardButtonAction, () => {
this.pushEventToGA(
this.$route.query[this.queryStrings.FMG_PAGE],
this.GaActions.SUBMITTED,
this.GaLabels.VIN_LOOKUP,
true
);
});
},
backButtonAction() {
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);

View file

@ -97,8 +97,13 @@ export default {
},
prependActionToMethod(object, method, actionToPrepend) {
const baseMethod = object[method.name];
object[method.name] = function () {
var baseMethod = object[method.name];
if(method.name.startsWith('bound ')){
baseMethod = method.name.substring(6);
}else{
baseMethod = object[method.name];
}
object[method.name.substring(6)] = function () {
actionToPrepend.apply(this, arguments);
return baseMethod.apply(object, arguments);
};