From 533bc558e062f0e6b7aafb9e4b955612b180d170 Mon Sep 17 00:00:00 2001 From: FrankRua Date: Fri, 29 Apr 2022 16:11:10 -0400 Subject: [PATCH] More events --- src/constants/analytics.js | 7 +++++-- src/helpers/unit-test-helper.js | 2 ++ src/layouts/license-plate-lookup/license-plate-lookup.vue | 3 +++ src/layouts/vin-lookup/vin-lookup.vue | 2 ++ src/mixins/base-mixin.js | 4 ++++ src/ux-components/button-main/button-main.vue | 2 ++ 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/constants/analytics.js b/src/constants/analytics.js index 297adf3db..f6f6ff82e 100644 --- a/src/constants/analytics.js +++ b/src/constants/analytics.js @@ -17,12 +17,15 @@ const GaCategories = { const GaActions = { RESULT: 'Result', CLICKED: 'Clicked', - VIF: 'vif' + VIF: 'vif', + SUBMITTED: 'Submitted', }; const GaLabels = { SUCCESS: 'Success', - ERROR: 'Error' + ERROR: 'Error', + LICENSE_PLATE_LOOKUP: 'License_Plate_Look_Up', + VIN_LOOKUP: 'Vin_Look_Up', }; diff --git a/src/helpers/unit-test-helper.js b/src/helpers/unit-test-helper.js index 95777d06b..f7e8047ca 100644 --- a/src/helpers/unit-test-helper.js +++ b/src/helpers/unit-test-helper.js @@ -8,6 +8,7 @@ import { Form } from "vee-validate"; import baseMixin from "@/mixins/base-mixin"; import { getCookieDomainValue } from "@/helpers/heritage-integration/cookie-helper"; import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents } from "@/constants/analytics"; +import { queryStrings } from "@/constants/query-strings"; // Common methods export function getMountOptions(mockData) { @@ -46,6 +47,7 @@ export function getMountOptions(mockData) { mocks.GaActions = GaActions; mocks.GaLabels = GaLabels; mocks.GaEvents = GaEvents; + mocks.queryStrings = queryStrings; // Mock $store and $router when accessing this.$store/$router mocks.$store = mockData.store; diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index f9f0cb41c..529bce55a 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -174,6 +174,9 @@ export default { this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route); }, async forwardButtonAction() { + + this.pushEventToGA(this.$route.query[this.queryStrings.FMG_PAGE], this.GaActions.SUBMITTED, this.GaLabels.LICENSE_PLATE_LOOKUP , true); + const zipValidation = this.serviceZip ? await this.validateZip(this.serviceZip) : await this.validateZip(this.registrationZip); if (!zipValidation.data.isServiceable) { this.$refs.funnelFooter.removeLoader(); diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 1967635a8..3d79faedd 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -180,6 +180,8 @@ export default { this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route); }, async forwardButtonAction() { + this.pushEventToGA(this.$route.query[this.queryStrings.FMG_PAGE], this.GaActions.SUBMITTED, this.GaLabels.VINLOOKUP , true); + const zipValidation = await this.validateZip(this.zip); if (!zipValidation.data.isServiceable) { this.customAlertData.zip = this.zip; diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 43ce3f6f0..f3b29ca17 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -3,6 +3,7 @@ import { storeActions } from "@/constants/store-actions.js"; import { storeMutations } from "@/constants/store-mutations.js"; import { navigationScenarios } from "@/router/router-constants/navigation-scenarios"; import { vehicleCategories } from "@/constants/vehicle-categories.js"; +import { queryStrings } from "@/constants/query-strings"; export default { data() { @@ -54,6 +55,9 @@ export default { vehicleCategories() { return vehicleCategories; }, + queryStrings(){ + return queryStrings; + } }, }; diff --git a/src/ux-components/button-main/button-main.vue b/src/ux-components/button-main/button-main.vue index df422234d..00a17a7b6 100644 --- a/src/ux-components/button-main/button-main.vue +++ b/src/ux-components/button-main/button-main.vue @@ -16,6 +16,7 @@