添加 Google 分析到 HTML 代码错误

Adding Google Analytics to HTML code error

我正在尝试通过 HTML 路径将 Google 分析插入到我的代码中。我已正确创建一个 Analytics 帐户,将我的网站配置到我的网站管理员帐户,并将更改提交到我的网站。我还确保保持 Analytics 代码不变,以至于我什至只保留了行间距。以下片段是我 HTML 头脑中的代码(据我所知,我打算这样做)。

<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-65362973-1', 'auto');
ga('send', 'pageview');

</script>
</head>

但是,我的站点是 Github 事件。这可能是问题所在吗?还是我错过了一个不太明显的步骤?非常感谢任何帮助!

这直接来自文档。我个人的经验是小网站24小时。如果您在实时报告中看到数据,则表明其正在运行。如果它是一个全新的站点,则可能需要 48-72 小时才能显示数据。否则以下是正确的

Data processing latency

Processing latency is 24-48 hours. Standard accounts that send more than 200,000 sessions per day to Google Analytics will result in the reports being refreshed only once a day. This can delay updates to reports and metrics for up to two days. To restore intra-day processing, reduce the number of sessions you send to < 200,000 per day. For Premium accounts, this limit is extended to 2 billion hits per month.