简体   繁体   English

同一Google Analytics(分析)事件一次触发两次

[英]Same Google Analytics event fires twice on one call at a same time

Well, the problem pretty obvious: when I exec next code 好了,问题很明显:当我执行下一个代码时

_gaq.push(['_trackEvent',
'CategoryTest',
'ActionTest',
'test;  UUID;']);

I expect to have a new event, but instead, I got on my GA account two identical events (raised at the same time) 我希望有一个新事件,但我却在我的Google Analytics(分析)帐户上获得了两个相同的事件(同时引发)

After some investigation, I found out that it actually fires two events (obviously lol). 经过一番调查,我发现它实际上引发了两个事件(显然是哈哈)。
First one - to http://www.google-analytics.com/ with Request Method: GET Status Code: 307 Internal Redirect 第一个-使用请求方法: http//www.google-analytics.com/到GET状态代码:307内部重定向
And a second - https://www.google-analytics.com/ with Request Method: GET Status Code: 200 (green) 第二个-https : //www.google-analytics.com/ ,请求方法:GET状态代码:200(绿色)

I was trying to change permissions for the extension to not use HTTP (not S), but it didn`t work out. 我试图将扩展名的权限更改为不使用HTTP(而不是S),但是没有成功。
Right now I doubling stats for my extension, what I actually don't want to do. 现在,我将自己的扩展程序的统计信息加倍,实际上是我不想做的。

Also, I checked out if maybe eventListener fires twice for some reason - but it`s not. 另外,我检查了是否由于某种原因eventListener触发了两次-但事实并非如此。 Event listener calls only once and _gaq.push calls only once, but two events stored. 事件监听器仅调用一次,_gaq.push仅调用一次,但存储了两个事件。
(if call _gaq.push from browser console - you got two events as well) (如果从浏览器控制台调用_gaq.push-您也会收到两个事件)

I think you should: 我想你应该:

  • Upgrade to GA Universal Analytics tracker ( ga ) which was introduced as a replacement of the legacy GA analytics tracker ( _gaq ) 7 years ago in 2012. 升级到GA Universal Analytics跟踪器ga ),该跟踪器是在7年前(2012年)取代旧版GA分析跟踪器_gaq )推出的。
  • Use the forceSSL option 使用forceSSL选项
  • Use the Chrome GA Debugger and inspect the console for any error message 使用Chrome GA调试器并检查控制台中是否有任何错误消息
  • Rely on the GA Real-time report to effectively see how many events are counted (the 307 might not be even though they generate 1 additional hit request) 依靠GA实时报告来有效查看计数了多少个事件(即使307产生了1个额外的匹配请求,也可能不是307个事件)
  • If the problem persists, provide the entire GA-related code you're using as a whole (not just the event tracking call) 如果问题仍然存在,请提供您整体上使用的与GA相关的完整代码 (而不仅仅是事件跟踪调用)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM