From bef4baf91b7aa4d34b4f36e5ccdf2e03ec09e2fa Mon Sep 17 00:00:00 2001 From: Katie Date: Wed, 5 Oct 2022 15:17:36 -0400 Subject: [PATCH] CSR-762 GA WIP --- .../base-input-button/base-input-button.vue | 42 ++++++++++--------- .../button-question/button-question.vue | 26 +++++++----- 2 files changed, 38 insertions(+), 30 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 dbde633a7..8f8bdaa16 100644 --- a/src/common-components/base-input-button/base-input-button.vue +++ b/src/common-components/base-input-button/base-input-button.vue @@ -79,7 +79,7 @@ export default { CLICK: "click", }; - console.log("Handling: ", eventType) + // console.log("Handling: ", eventType) if (this.isMultiSelect) { switch (eventType) { @@ -98,6 +98,8 @@ export default { } else { switch (eventType) { case eventTypes.CLICK: // TODO KO pushClickEventToGa? + this.pushClickEventToGA(); + // fallthrough case eventTypes.ENTER: case eventTypes.SPACE: this.handleClick(e); @@ -141,6 +143,7 @@ export default { handleClick(e) { this.handleSelectionChange(e); // console.log("addEventToBus: ", this.value?.toString()) + eventBus.readAndPopEventFromBus("GA", "click") eventBus.addEventToBus("GA", "click", { category: this.$route.query[queryStrings.FMG_PAGE], action: this.GaActions.CLICKED, @@ -150,25 +153,26 @@ export default { }); this.$emit("inputButtonClicked", this.valueToEmit); }, - // pushClickEventToGA(value) { - // const lastFocusedInputGroup = - // this.$store.getters.gaClickInformation.lastFocusedInputGroup; - // // this.disA MKJ `,,.patchStoreAction( - // // gaStoreActions.UPDATE_FIRED_GA_CLICK_EVENT_VALUES, - // // { - // // groupName: lastFocusedInputGroup, - // // value: value ?? this.value, - // // }, - // // ); + pushClickEventToGA(value) { + // const lastFocusedInputGroup = + // this.$store.getters.gaClickInformation.lastFocusedInputGroup; + // this.dispatchStoreAction( + // gaStoreActions.UPDATE_FIRED_GA_CLICK_EVENT_VALUES, + // { + // groupName: lastFocusedInputGroup, + // value: value ?? this.value, + // }, + // ); - // // this.pushEventToGA( - // // this.$route.query[queryStrings.FMG_PAGE], - // // this.GaActions.CLICKED, - // // value?.toString() ?? this.value?.toString(), - // // true, - // // this.valueToLogType - // // ); - // }, + console.log("BIB") + this.pushEventToGA( + this.$route.query[queryStrings.FMG_PAGE], + this.GaActions.CLICKED, + value?.toString() ?? this.value?.toString(), + true, + this.valueToLogType + ); + }, // handleBlur() { // // this.dispatchStoreAction( // // gaStoreActions.UPDATE_LAST_FOCUSED_INPUT_GROUP, diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue index d607d6091..da932c3a4 100644 --- a/src/common-components/button-question/button-question.vue +++ b/src/common-components/button-question/button-question.vue @@ -13,7 +13,6 @@
-