且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Google Analytics缺少analytics.js脚本

更新时间:2023-02-03 12:37:19

Not sure if this will fix the issue, but you are telling the browsers to parse the script as "rocketscript":

<script type="text/rocketscript">
  (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');
....

I don't know what rocketscript is and I guess neither does the Tag Assistant. Try to change this to "javascript" or not to use a type attribute at all.

Here is a discussion about rocketscript, apparently this is part of some Cloud technology and requires a special plugin in Wordpress.

I see tracking calls in the network tab of the browser, so it looks like the problem might very well be purely cosmetic (altough chromes GA debugger extension does not pick up the calls, either).