diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index 1d577a315..b4c8e89fb 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -167,6 +167,34 @@ export default { lastValuePushedToGa: null, }; }, +<<<<<<< HEAD:src/digital-components/button-question/button-question.vue +======= + watch: { + answers() { + //once we get the answers to display from parent, see if we need a GA event to log what we showed + if (this.logDisplayedValuesEvent && this.answers.length > 0) { + var eventLabel = ""; + //build comma separated list of all items in button list that we are going to display on page + this.answers.forEach((item) => { + if (item.Name) { + eventLabel += item.Name + ","; + } + if (item.buttonLabel) { + eventLabel += item.buttonLabel + ","; + } + }); + + eventLabel = eventLabel.slice(0, -1); //remove the last comma + this.pushEventToGA( + this.$route.query[queryStrings.FMG_PAGE], + this.GaActions.DISPLAYED, + eventLabel, + true + ); + } + }, + }, +>>>>>>> 2023.05.04:src/common-components/button-question/button-question.vue computed: { getFieldSetClasses() { const baseClasses = this.isOverflowScrollable @@ -264,7 +292,12 @@ export default { var eventLabel = ""; //build comma separated list of all items in button list that we are going to display on page this.answers.forEach((item) => { - eventLabel += item.Name + ","; + if (item.Name){ + eventLabel += item.Name + ","; + } + if (item.buttonLabel) { + eventLabel += item.buttonLabel + ","; + } }); eventLabel = eventLabel.slice(0, -1); //remove the last comma diff --git a/src/layouts/quote/service-package-question/service-package-question.vue b/src/layouts/quote/service-package-question/service-package-question.vue index b94d21dce..29e6a9a9e 100644 --- a/src/layouts/quote/service-package-question/service-package-question.vue +++ b/src/layouts/quote/service-package-question/service-package-question.vue @@ -7,7 +7,8 @@ :buttonTypeObject="servicePackageRadio" v-model="selectedPackageName" :validationRules="validationRules" - :isRequired="isRequired" /> + :isRequired="isRequired" + :logDisplayedValuesEvent="true" />