最新消息:20210917 已从crifan.com换到crifan.org

【已放弃】尝试给国内网站添加google analytics统计功能

google crifan 5107浏览 0评论

折腾:

【已解决】给公司网站中添加统计功能

想要给公司网站,国内的,添加统计功能,打算用google analytics。

先去注册google账号

Analytics

登录 – Google 帐号

我的帐号

https://myaccount.google.com/?pli=1

Google Analytics(分析)

点击注册

Google Analytics(分析)

Google Analytics(分析)

<!– Global site tag (gtag.js) – Google Analytics –>

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxx"></script>

<script>

  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag(‘js’, new Date());

  gtag(‘config’, ‘UA-xxxx’);

</script>

然后去把代码加到主页的html中

然后才注意到:

此处的script的src的地址中是:

https://www.googletagmanager.com

而这个地址,不翻墙的情况下,无法打开

-》而公司网站是国内的,所以没法使用。

https://www.googletagmanager.com 国内

而自己此处翻墙是可以打开:

https://www.googletagmanager.com/gtag/js?id=xxxx

本来想,要不下载下来,放到自己网站上,或许可用?

再想想,不行,因为里面有其他的google的js

比如:

http://www.gstatic.com/wcm/loader.js

还是无法加载和访问。

转载请注明:在路上 » 【已放弃】尝试给国内网站添加google analytics统计功能

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (1)

  1. 现在可以2021亲测
    20213年前 (2021-02-10)回复
97 queries in 0.189 seconds, using 23.44MB memory