我正在尝试在我的网站上设置谷歌分析但是,它不起作用。例如,在跟踪信息中显示:状态:未安装跟踪。我已经在我的标签之前将他们提供的代码添加到我的 header.php 文件中</head>
。
我添加的代码是:
<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>
我在页内分析部分看到我的网站,但收到一条错误消息:
Your site doesn't load ga.js from Google. If you host the Google tracking code on your
own servers, it isn't updated automatically and can miss important changes.
We didn't find a tracking snippet on your site. In-Page Analytics cannot load. Please
make sure you have tracking installed correctly. If your snippet is included in a
separate JavaScript file, you'll have to manually check it is being loaded correctly.
有人可以帮我弄这个吗?我该如何解决这个问题?