javascript Google 分析:未安装跟踪

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16904846/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 06:25:26  来源:igfitidea点击:

Google analytics: Tracking Not Installed

javascriptwordpressseogoogle-analytics

提问by Chris

I am trying to setup Google Analytics on my site, however it will not detect that it is being tracked.

我正在尝试在我的网站上设置 Google Analytics,但它不会检测到它正在被跟踪。

I have placed the code they provided in my header.php right before the </head>as recommended:

我已经</head>按照建议将他们提供的代码放在我的 header.php 中:

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-41420598-1', 'example.com');
ga('send', 'pageview');

</script>

Not really sure what else to do..

真的不知道还能做什么..

回答by drs

It took a day or two after I put the tracking code on each of my pages for the status on my Google Analytics Tracking Info tab to be updated from "Tracking Not Installed" to "Universal Analytics is enabled for this property". During this time I was seeing regular activity in my tracking reports.

在我将跟踪代码放在我的每个页面上后,我花了一两天时间将 Google Analytics 跟踪信息选项卡上的状态从“跟踪未安装”更新为“Universal Analytics 已为此媒体资源启用”。在此期间,我在跟踪报告中看到了定期活动。

If you're brand new to Google Analytics, the default reports only include data up to the previous day. If you want to check for activity on the same day that you added the tracking code, you have to adjust the date range to include the current day's activity.

如果您是 Google Analytics 的新手,默认报告仅包含前一天的数据。如果您想在添加跟踪代码的同一天检查活动,您必须调整日期范围以包括当天的活动。

回答by ceejayoz

That's their new tracking code, I wouldn't be surprised if their detector isn't set up to find it yet. Go into the Google Analytics real-time dashboard and see if your pageviews are showing up - if they are, don't worry about the incorrect flagging.

这是他们的新跟踪代码,如果他们的检测器尚未设置为找到它,我不会感到惊讶。进入 Google Analytics 实时仪表板,查看您的综合浏览量是否显示 - 如果显示,请不要担心错误标记。

回答by user3908875

I fix this by using the asynchronous script first, then visiting a page on the site, refreshing the GA screen to check if the status has been changed, then replacing the GA script with the Universal script once the status has been updated. It works every time. It makes my clients happy.

我首先使用异步脚本来解决这个问题,然后访问站点上的页面,刷新 GA 屏幕以检查状态是否已更改,然后在状态更新后将 GA 脚本替换为通用脚本。它每次都有效。这让我的客户很高兴。