我只想知道这个脚本的用途..
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
我在一些网站上发现了这个.. :)
还有这个..
var pageTracker = _gat._getTracker("UA-1965499-1");
pageTracker._initData();
pageTracker._trackPageview();
最佳答案
它的 Google Analytics跟踪器代码。
引自此链接:http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55591
Google Analytics shows you how people found your site, how they explored it, and how you can enhance their visitor experience. With this information, you can improve your website return on investment, increase conversions, and make more money on the web. This guide can help you familiarize yourself with the main features of Google Analytics.
现在,此页面建议使用您提到的代码: http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55488
虽然,这是旧的(传统的)方法。 Google 引入了用于添加跟踪器代码的新异步方法。
关于Javascript gaJs主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5055048/