diff --git a/src/constants/analytics.js b/src/constants/analytics.js index f6f6ff82e..a3f057150 100644 --- a/src/constants/analytics.js +++ b/src/constants/analytics.js @@ -26,6 +26,7 @@ const GaLabels = { ERROR: 'Error', LICENSE_PLATE_LOOKUP: 'License_Plate_Look_Up', VIN_LOOKUP: 'Vin_Look_Up', + ADDRESS_LOOKUP: 'Address_Look_up', }; diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 54f096896..87278476a 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -152,6 +152,17 @@ export default { this.$route ); }, + attachCustomEvents() { + this.prependActionToMethod(this, this.forwardButtonAction, this.logGAEventForVin()); + }, + logGAEventForVin(){ + this.pushEventToGA( + this.$route.query[this.queryStrings.FMG_PAGE], + this.GaActions.SUBMITTED, + this.GaLabels.ADDRESS_LOOKUP, + true + ); + }, getRegistrationAddressFromStore() { return store.getters.vehicle.registration.address; }, @@ -337,6 +348,9 @@ export default { }, }, + mounted() { + this.attachCustomEvents(); + }, computed: { AlertNonServiceableZipHeader(){ const zipCode = this.serviceZipCode ? this.serviceZipCode : this.customerQuestions.addressQuestions.zipCode; diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 5e7fdc2c1..13f50ecc4 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -187,14 +187,15 @@ export default { store.dispatch(storeActions.RESET_PARTS_STATE_AND_DEPENDENCIES); }, attachCustomEvents() { - this.prependActionToMethod(this, this.forwardButtonAction, () => { - this.pushEventToGA( + this.prependActionToMethod(this, this.forwardButtonAction, this.logGAEventForVin()); + }, + logGAEventForVin(){ + 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; diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 0294716af..4dc1f6382 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -192,6 +192,9 @@ export default { vinPopulatedOnPageLoad: this.getVinFromStore()?.length > 0, }; }, + mounted() { + this.attachCustomEvents(); + }, computed: { perfectMatchNewVinAlert() { return this.vinPopulatedOnPageLoad && this.vin === this.getVinFromStore(); @@ -255,15 +258,16 @@ export default { getZipFromStore(){ return store.getters.order.serviceLocation.zipCode; }, - attachCustomEvents() { - this.prependActionToMethod(this, this.forwardButtonAction, () => { - this.pushEventToGA( + attachCustomEvents() { + this.prependActionToMethod(this, this.forwardButtonAction, this.logGAEventForVin()); + }, + logGAEventForVin(){ + this.pushEventToGA( this.$route.query[this.queryStrings.FMG_PAGE], this.GaActions.SUBMITTED, - this.GaLabels.VINLOOKUP, + this.GaLabels.VIN_LOOKUP, true ); - }); }, backButtonAction() { this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);