commit
3bfce275d5
1 changed files with 4 additions and 3 deletions
|
|
@ -6,12 +6,10 @@ import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents } from
|
||||||
|
|
||||||
import baseMixin from "@/mixins/base-mixin";
|
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 {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
logPageView(pageEvent) {
|
logPageView(pageEvent) {
|
||||||
|
const currentPageName = getPageNameByQueryString();
|
||||||
var payload = {
|
var payload = {
|
||||||
userId: getDeviceIdValue(),
|
userId: getDeviceIdValue(),
|
||||||
sessionKey: getSessionKeyValue(),
|
sessionKey: getSessionKeyValue(),
|
||||||
|
|
@ -26,6 +24,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
logCustomEvent(category, action, label, value) {
|
logCustomEvent(category, action, label, value) {
|
||||||
|
const currentPageName = getPageNameByQueryString();
|
||||||
var payload = {
|
var payload = {
|
||||||
userId: getDeviceIdValue(),
|
userId: getDeviceIdValue(),
|
||||||
sessionKey: getSessionKeyValue(),
|
sessionKey: getSessionKeyValue(),
|
||||||
|
|
@ -42,6 +41,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
pushEventToGA(category, action, label, pushToLogApp = false) {
|
pushEventToGA(category, action, label, pushToLogApp = false) {
|
||||||
|
const currentPageName = getPageNameByQueryString();
|
||||||
const eventToBePushed = {
|
const eventToBePushed = {
|
||||||
'event': GaEvents.GENERIC_EVENT,
|
'event': GaEvents.GENERIC_EVENT,
|
||||||
'category': category,
|
'category': category,
|
||||||
|
|
@ -60,6 +60,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
pushPageViewToGA() {
|
pushPageViewToGA() {
|
||||||
|
const currentPageName = getPageNameByQueryString();
|
||||||
const pageViewEvent = {
|
const pageViewEvent = {
|
||||||
'event': GaEvents.PAGE_VIEW_EVENT,
|
'event': GaEvents.PAGE_VIEW_EVENT,
|
||||||
'pagePath': `/fmg/?${queryStrings.FMG_PAGE}=${currentPageName}`,
|
'pagePath': `/fmg/?${queryStrings.FMG_PAGE}=${currentPageName}`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue