CSR-216 move the ga event log out of handlecheckchange

This was causing every item in the list to log an event not just the selected item.
This commit is contained in:
CarlNation 2022-05-20 16:24:52 -04:00
parent 9071ddcffd
commit adb74675ff
5 changed files with 8 additions and 5 deletions

View file

@ -52,7 +52,6 @@ import listButtonHorizontal from "@/ux-components/list-button-horizontal/list-bu
import listCard from "@/ux-components/list-card/list-card";
import { ErrorMessage } from 'vee-validate';
import radio from "@/ux-components/radio/radio";
import { queryStrings } from "@/constants/query-strings";
export default {
name: "buttonQuestion",
@ -135,8 +134,6 @@ export default {
},
handleCheckedChanged(val) {
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, val.value, true);
if(this.isMultiSelect && this.selectedValues) {
// Add or remove item to array of data to emit
const newSelectedValues = this.selectedValues;

View file

@ -11,7 +11,7 @@ export default {
logPageView(pageEvent) {
// if the user does not have a session id from the content site, do not log.
const sid = getSessionIdValue();
if (sid === '00000000-0000-0000-0000-000000000000') {
if (sid === '00000000-0000-0000-0000-000000000000' || sid == null) {
return;
}
@ -32,7 +32,7 @@ export default {
logCustomEvent(category, action, label, value) {
// if the user does not have a session id from the content site, do not log.
const sid = getSessionIdValue();
if (sid === '00000000-0000-0000-0000-000000000000') {
if (sid === '00000000-0000-0000-0000-000000000000' || sid == null) {
return;
}

View file

@ -54,6 +54,7 @@
<script>
import { useField } from "vee-validate";
import loader from "@/ux-components/loader/loader";
import { queryStrings } from "@/constants/query-strings";
export default {
name: "listButtonHorizontal",
@ -120,6 +121,7 @@ export default {
this.handleCheckChange();
}
this.handleChange(this.value);
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true);
},
handleCheckChange() {
const emitEvent = {

View file

@ -54,6 +54,7 @@
<script>
import { useField } from "vee-validate";
import loader from "@/ux-components/loader/loader";
import { queryStrings } from "@/constants/query-strings";
export default {
name: "listButton",
@ -120,6 +121,7 @@ export default {
this.handleCheckChange();
}
this.handleChange(this.value);
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true);
},
handleCheckChange() {
const emitEvent = {

View file

@ -61,6 +61,7 @@
<script>
import { useField } from "vee-validate";
import { queryStrings } from "@/constants/query-strings";
export default {
name: "listCard",
@ -137,6 +138,7 @@ export default {
this.handleCheckChange();
}
this.handleChange(this.value);
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true);
},
handleCheckChange() {
const emitEvent = {