Google Universal Analytics - 命令被忽略 [英] Google Universal Analytics - Command ignored
问题描述
我使用Google Universal Analytics跟踪页面浏览量。我可以看到何时导航到具有Google Analytics网站实时功能的页面,因此我的代码必须正常工作。然而,Chrome浏览器不断在控制台中显示:
初始化Google Analytics
运行命令:ga(set,page,/ My Url here )
命令被忽略。未知目标:undefined
运行命令:ga(send,pageview)
命令被忽略。未知目标:未定义
紧随Google Analytics的实际数据,并结合查看我的观点在实时面板中,意味着数据发送成功。那么究竟是怎么回事,如果GA认为这个命令是未定义的,为什么它仍然在发送它? 我会检查您的GA初始化正在正确执行。确保你的UA#在类似的声明中
ga('create','UA-XXXX-Y')
它看起来像是您的数据显示在实时报告中。
请确保您上面发布的代码正在GA初始化代码下运行,并且初始化代码位于GA的末尾,紧跟在后面'正在使用GTM。
I'm using Google Universal Analytics to track page views. I can see when I navigate to the pages with the real time feature of the Google Analytics site, so my code must be working.
However Chrome keeps displaying this in the console:
Initializing Google Analytics
Running command: ga("set", "page", "/My Url here")
Command ignored. Unknown target: undefined
Running command: ga("send", "pageview")
Command ignored. Unknown target: undefined
Shortly followed by the actual data to Google Analytics, which in combination with seeing my view in the Real Time panel, means that the data is successful being sent. So what is actually going on, if GA thinks the command is undefined, why is it still sending it?
I would check that your GA initialization is being executed properly. Make sure that your UA# is inside a statement like so
ga('create', 'UA-XXXX-Y')
It looks like it is if your data is showing up on the real-time report.
Make sure that the code that you posted above is being run below the GA initialization code and the initialization code is at the end of the for GA and just after the if you're using GTM.
这篇关于Google Universal Analytics - 命令被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!