Я пытаюсь отправить пользовательские события из приложения Angular 2 в Google Analytics
вот код
ga('send', 'event', {
eventCategory: eventCategory,
eventLabel: eventLabel,
eventAction: eventAction,
eventValue: eventValue
});
вот как я это называю:
this.googleAnalyticsService.sendEvent("testCategory", "testAction", "testLabel", 10);
проверяя просмотр в реальном времени, на вкладке «События» я вижу, что все события «Категория события» и «Действие события» являются «неопределенными»
Я попытался отредактировать тег "Google Analytics" в Диспетчере тегов и установить
"category" field to "eventCategory"
"label" field to "eventLabel"
"action" field to "eventAction"
"value" field to "eventValue"
но без удачи, кто-нибудь может мне помочь?
[править]
событие на самом деле вообще не запускается, если я не установлю значения в самом теге
но как я могу получить фактические значения, отправленные из моего кода ???
введите описание изображения здесь
вот журналы отладчика GA:
по-видимому, GA отправляет событие с «неопределенными» полями
отправляется и мой собственный ga.send, поэтому я не знаю, почему этот не срабатывает
Initializing Google Analytics.
analytics_debug.js:10 Running command: ga("create", "UA-********-3", {name: "gtm4"})
analytics_debug.js:10 Creating new tracker: gtm4
analytics_debug.js:10 Running command: ga("gtm4.set", ">m", "G9452W68FS")
analytics_debug.js:10 Running command: ga("gtm4.set", "nonInteraction", false)
analytics_debug.js:10 Running command: ga("gtm4.set", "hitCallback", [function])
analytics_debug.js:10 Running command: ga("gtm4.send", {hitType: "event", eventCategory: "undefined", eventAction: "undefined", eventLabel: undefined, eventValue: undefined})
analytics_debug.js:10 Setting throttling cookie: "_gat_UA-********-3"
analytics_debug.js:10
Sent beacon:
v=1&_v=j68d&a=708558753&t=event&ni=0&_s=1&dl=https%3A%2F%2F*******************%2Fa%2Fgifts%3Fs%3D**************************************%26pid%3D14%26m%3D0%26categories%3D%26p%3D0&ul=fr-fr&de=UTF-8&sd=24-bit&sr=1920x1080&vp=1903x943&je=0&ec=undefined&ea=undefined&_u=QAGAAAAB~&jid=1225520003&gjid=48267034&cid=804438810.1535016930&tid=UA-********-3&_gid=121630742.1536576429&_r=1>m=G9452W68FS&z=461818314
analytics_debug.js:10 <unknown> (>m) G9452W68FS
analytics_debug.js:10 _j1 (&jid) 1225520003
analytics_debug.js:10 _j2 (&gjid) 48267034
analytics_debug.js:10 adSenseId (&a) 708558753
analytics_debug.js:10 apiVersion (&v) 1
analytics_debug.js:10 clientId (&cid) 804438810.1535016930
analytics_debug.js:10 encoding (&de) UTF-8
analytics_debug.js:10 eventAction (&ea) undefined
analytics_debug.js:10 eventCategory (&ec) undefined
analytics_debug.js:10 hitType (&t) event
analytics_debug.js:10 javaEnabled (&je) 0
analytics_debug.js:10 language (&ul) fr-fr
analytics_debug.js:10 location (&dl) https://*******************/a/gifts?s=**************************************&pid=14&m=0&categories=&p=0
analytics_debug.js:10 nonInteraction (&ni) 0
analytics_debug.js:10 screenColors (&sd) 24-bit
analytics_debug.js:10 screenResolution (&sr) 1920x1080
analytics_debug.js:10 trackingId (&tid) UA-********-3
analytics_debug.js:10 viewportSize (&vp) 1903x943
analytics_debug.js:10 Running command: ga("set", "page", "/a/gifts?s=**************************************&pid=14&m=0&categories=&p=0")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("send", "pageview")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("set", "page", "/a/gifts?s=**************************************&pid=14&m=0&categories=&p=0")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("send", "pageview")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("set", "page", "/a/gifts?s=**************************************&pid=14&m=0&categories=&p=0")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("send", "pageview")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("set", "page", "/a/gifts?s=**************************************&pid=14&m=0&categories=&p=0")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("send", "pageview")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("set", "page", "/a/gifts?s=**************************************&pid=14&m=0&categories=&p=0")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("send", "pageview")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("set", "page", "/a/gifts?s=**************************************&pid=14&m=0&categories=&p=0")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Running command: ga("send", "pageview")
analytics_debug.js:10 Command ignored. Unknown target: undefined
analytics_debug.js:10 Registered new plugin: ga(provide, "render", Function)
main.79214c40a0c056e8e45c.106.32125.bundle.js:1 sending to ga Product Details Page Page Displayed Sports & Loisirs 14
analytics_debug.js:10 Executing Google Analytics commands.
analytics_debug.js:10 Running command: ga("send", "event", {eventCategory: "Product Details Page", eventLabel: "Sports & Loisirs", eventAction: "Page Displayed", eventValue: 14})
analytics_debug.js:10 Command ignored. Unknown target: undefined
спасибо