CSR-18 page name function only called once so never it changed

This commit is contained in:
CarlNation 2022-05-11 15:16:03 -04:00
parent 83c649fc8d
commit 93c12a127e

View file

@ -6,12 +6,10 @@ import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents } from
import baseMixin from "@/mixins/base-mixin";
// We will need current page name for multiple methods, define it once to re-use.
const currentPageName = getPageNameByQueryString();
export default {
methods: {
logPageView(pageEvent) {
const currentPageName = getPageNameByQueryString();
var payload = {
userId: getDeviceIdValue(),
sessionKey: getSessionKeyValue(),
@ -26,6 +24,7 @@ export default {
},
logCustomEvent(category, action, label, value) {
const currentPageName = getPageNameByQueryString();
var payload = {
userId: getDeviceIdValue(),
sessionKey: getSessionKeyValue(),
@ -42,6 +41,7 @@ export default {
},
pushEventToGA(category, action, label, pushToLogApp = false) {
const currentPageName = getPageNameByQueryString();
const eventToBePushed = {
'event': GaEvents.GENERIC_EVENT,
'category': category,
@ -60,6 +60,7 @@ export default {
},
pushPageViewToGA() {
const currentPageName = getPageNameByQueryString();
const pageViewEvent = {
'event': GaEvents.PAGE_VIEW_EVENT,
'pagePath': `/fmg/?${queryStrings.FMG_PAGE}=${currentPageName}`,