基本设置:我有index.html
页面,<head>
标记结束前的常用Google代码段,在我的react-components.js文件中,我有以下内容:
ga('send','event','Comments','view','mainListItem');
我正在使用Google Analytics插件开发工具,似乎确认我发送的活动很好。我还在发送代码中进行了回调,它也回复了。我从家里的测试服务器(localhost)发送这个,但是每当我刷新页面时,它都会在实时跟踪页面上注册我的活动,为什么不发生这个事件呢?此外,自事件发出以来,已经过了大约半小时/小时;不确定他们是否只会在24小时后出现。以下是开发工具向我展示的内容:
Account ID : UA-XXXXXXX-Y // not actually X in the code.
Page Title : Disqus Comments
Host Name : disqus.com
Page : /embed/comments/?base=default&version=4aca534a0baee76617eb115212993522&f=mtg-hunter&t_i=382866&t_u=http%253A%252F%252Fmtg-hunter.com%252F%253Fq%253DBlack%2520Lotus%2523!newthread&t_e=Black%2520Lotus&t_d=MtG%253A%2520Hunter&t_t=Black%2520Lotus&t_c=4523863&s_o=default
Referring URL : http://localhost:3333/
Hit ID : 1092606028
Hit Type : event
Event Name : next
Event Type : view_embed
Event Label : mtg-hunter
Event Value : 1
Visitor ID : 1810044494
Session Count : 2
Session Time - First : Fri May 20 2016 20:04:12 GMT-0600 (Mountain Daylight Time)
Session Time - Last : Fri May 20 2016 20:04:12 GMT-0600 (Mountain Daylight Time)
Session Time - Current : Fri May 20 2016 21:16:42 GMT-0600 (Mountain Daylight Time)
Campaign Time : Fri May 20 2016 21:16:42 GMT-0600 (Mountain Daylight Time)
Campaign Session : 2
Campaign Count : 2
Campaign Source : localhost:3333
Campaign Medium : referral
Campaign Name : (referral)
Campaign Content : /;
Custom Var 1 : label:'component' value:'embed' scope:'Page'
Custom Var 2 : label:'package' value:'free' scope:'Page'
Custom Var 3 : label:'forum' value:'mtg-hunter' scope:'Page'
Custom Var 4 : label:'version' value:'next' scope:'Page'
Custom Var 5 : label:'userType' value:'not_logged_in' scope:'Page'
Language : en-us
Encoding : UTF-8
Flash Version : 21.0 r0
Java Enabled : false
Screen Resolution : 1920x1080
Browser Size : 737x384
Color Depth : 24-bit
Ga.js Version : 5.6.7d
Cachebuster : 1520316656
然而,事件报告完全是空白的。我正在使用一个不过滤我的IP的视图(这就是为什么我看到自己在实时报告中刷新页面的原因),所以这不是问题。我正在向我的代码的重要部分添加事件,我希望在生成代码之前对它们进行测试,但也许我只会在实时用户发送事件时获得结果?