几乎每个网站都会统计自身的浏览状况:日IP、PV、跳出率、转换率、浏览者属性等。了解这些数据有助于更好地了解浏览者的属性、知道网站在什么地方存在缺陷,为更好地提供服务、提高网站收入都有所帮助。
对于大多数网站而言,Google Analytics是最普遍选择的方案,因为Google Analytics提供了非常强大的功能,最重要的是,它是免费的,而且不会像某些统计网站那样,会要求网站主在网站上标明是用它来统计的。
但是,很多人在使用Google Analytics时只是简单地将Google提供的统计代码放到网站中去,实际上Google Analytics有不少鲜为人知的实用技巧,这篇文章将介绍其中一些。

搜索引擎
Google, Google Analytics, IP, PV, SEO, 使用技巧, 报表, 浏览者属性, 跳出率, 转换率
Google Analytics(谷歌分析)为我们提供了强大的网站统计功能,其中Custom Reports(自定义报告)功能更是为我们扩展统计功能提供了方便。在这里我们探讨一下通过自定义报告功能跟踪用户行为的方法。
Google Analytics的统计代码分为标准统计和异步统计两种,因此我们分开讨论。先看看两种基本的统计代码:
标准统计
<script type=”text/javascript”>
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”));
</script>
<script type=”text/javascript”>
try{
var pageTracker = _gat._getTracker(“UA-xxxxxx-x”);
pageTracker._trackPageview();
} catch(err) {}</script> |
异步统计
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);(function() {
var ga = document.createElement(’script’);
ga.src = (‘https:’ == document.location.protocol ?
‘https://ssl’ : ‘http://www’) +
‘.google-analytics.com/ga.js’;
ga.setAttribute(‘async’, ‘true’);
document.documentElement.firstChild.appendChild(ga);
})(); |
开放平台
Google Analytics, 优化网站, 用户行为, 跟踪