From 14bed5524c40d2fa2080048146dbe0aa7a5fe8ee Mon Sep 17 00:00:00 2001 From: Katie Date: Fri, 30 Sep 2022 09:20:15 -0400 Subject: [PATCH] CSR-762 Wrap up GA events --- .../base-input-button/base-input-button.vue | 14 ++-- .../button-back/button-back.vue | 1 + src/mixins/base-mixin.js | 66 +++++++++++++++---- src/ux-components/button-main/button-main.vue | 30 ++++++--- src/ux-components/text-link/text-link.vue | 10 +-- 5 files changed, 87 insertions(+), 34 deletions(-) diff --git a/src/common-components/base-input-button/base-input-button.vue b/src/common-components/base-input-button/base-input-button.vue index 968259c80..e6861a638 100644 --- a/src/common-components/base-input-button/base-input-button.vue +++ b/src/common-components/base-input-button/base-input-button.vue @@ -26,9 +26,9 @@ import { queryStrings } from "@/constants/query-strings"; import { useField } from "vee-validate"; import { toRef } from "vue"; import { gaStoreActions } from "../../constants/store-actions"; -import store from "../../store"; -// TODO KO Bug: select a chip via radio button, hit continue - doesn't fire the chip number +// TODO KO Bug: select crack via keyboard, continue - doesn't fire +// TODO KO Bug: select a chip via keyboard, hit continue - doesn't fire the chip number export default { name: "base-input-button", emits: ["change"], @@ -100,7 +100,7 @@ export default { case eventTypes.CLICK: case eventTypes.KEYPRESS_SUBMIT: this.handleClick(e); - this.test(); + this.pushClickEventToGAIfReady(); break; case eventTypes.CHANGE: this.selectOnKeypress @@ -143,7 +143,7 @@ export default { }, pushClickEventToGA(value) { const lastFocusedInputGroup = - store.getters.gaClickInformation.lastFocusedInputGroup; + this.$store.getters.gaClickInformation.lastFocusedInputGroup; this.dispatchStoreAction( gaStoreActions.UPDATE_FIRED_GA_CLICK_EVENT_VALUES, { @@ -173,10 +173,10 @@ export default { ); }, handleKeyboardNavigation(key) { - this.test(key); + this.pushClickEventToGAIfReady(key); }, - test(event) { - const gaClickInformation = store.getters.gaClickInformation; + pushClickEventToGAIfReady(event) { + const gaClickInformation = this.$store.getters.gaClickInformation; const firedGaClickEventValues = gaClickInformation.firedGaClickEventValues; const currentlySelectedValues = diff --git a/src/common-components/funnel-sub-header/button-back/button-back.vue b/src/common-components/funnel-sub-header/button-back/button-back.vue index cf3a630bf..6112806bb 100644 --- a/src/common-components/funnel-sub-header/button-back/button-back.vue +++ b/src/common-components/funnel-sub-header/button-back/button-back.vue @@ -1,6 +1,7 @@