<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>简单生活 —— Kevin Yang的博客 &#187; WebAnalytics</title> <atom:link href="http://www.imkevinyang.com/categories/techarticles/webanalytics/feed" rel="self" type="application/rss+xml" /><link>http://www.imkevinyang.com</link> <description>It&#039;s all about sharing</description> <lastBuildDate>Thu, 29 Jul 2010 17:50:43 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Document.Referrer丢失的几个原因</title><link>http://www.imkevinyang.com/2010/01/document-referrer%e4%b8%a2%e5%a4%b1%e7%9a%84%e5%87%a0%e4%b8%aa%e5%8e%9f%e5%9b%a0.html</link> <comments>http://www.imkevinyang.com/2010/01/document-referrer%e4%b8%a2%e5%a4%b1%e7%9a%84%e5%87%a0%e4%b8%aa%e5%8e%9f%e5%9b%a0.html#comments</comments> <pubDate>Sun, 17 Jan 2010 17:19:00 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[WebAnalytics]]></category> <category><![CDATA[Document]]></category> <category><![CDATA[Google Analytics]]></category> <category><![CDATA[Referrer]]></category> <category><![CDATA[Web Analytics]]></category> <category><![CDATA[Web分析]]></category> <category><![CDATA[不兼容]]></category> <category><![CDATA[流量分析]]></category> <category><![CDATA[空字符串]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2010/01/document-referrer%e4%b8%a2%e5%a4%b1%e7%9a%84%e5%87%a0%e4%b8%aa%e5%8e%9f%e5%9b%a0.html</guid> <description><![CDATA[<h2>Referrer的重要性</h2><p>HTTP请求中有一个referer的报文头，用来指明当前流量的来源参考页。例如在www.sina.com.cn/sports/上点击一个链接到达cctv.com首页，那么就referrer就是www.sina.com.cn/sports/了。在Javascript中，我们可以通过document.referrer来获取同样的信息。通过这个信息，我们就可以知道访客是从什么渠道来到当前页面的。这对于Web Analyt&#8230;</p>]]></description> <content:encoded><![CDATA[<h2>Referrer的重要性</h2><p>HTTP请求中有一个referer的报文头，用来指明当前流量的来源参考页。例如在www.sina.com.cn/sports/上点击一个链接到达cctv.com首页，那么就referrer就是www.sina.com.cn/sports/了。在Javascript中，我们可以通过document.referrer来获取同样的信息。通过这个信息，我们就可以知道访客是从什么渠道来到当前页面的。这对于Web Analytics来说，是非常重要的，这可以告诉我们不同渠道带来的流量的分布情况，还有用户搜索的关键词等，都是通过分析这个referrer信息来获取的。</p><p>但是，出于各种各样的原因，有时候Javascript中读到的referrer却是空字符串。下面总结一下哪些情况下会丢失referrer。</p><h2>Referrer丢失的几个场景</h2><h3>修改Location对象进行页面导航</h3><p>Location对象是一个用于页面导航的非常实用的对象。因为他允许你只变更Url的其中一部分。例如从cn域名切换到com域名，其他部分不变：</p><pre class="csharpcode">window.location.hostname = &quot;<span class="str">example.com&quot;;</span></pre><p>但是，通过修改Location进行页面导航的方法，会导致在IE下丢失Referrer。</p><blockquote><p>IE5.5+ 下返回空字符串</p><p>Chrome3.0+，Firefox3.5，Opera9.6，Safari3.2.2均正常返回来源网页</p></blockquote><h3>window.open方式打开新窗口</h3><p>示例：</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">=&quot;#&quot;</span> <span class="attr">onclick</span><span class="kwrd">=&quot;window.open('http://www.google.com')&quot;</span><span class="kwrd">&gt;</span>访问Google<span class="kwrd">&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span></pre><p>点击此链接会在新窗口打开Google网站，我们在地址栏中输入以下js代码就可以看到发送的referrer了。</p><pre class="csharpcode">javascript:alert(document.referrer)</pre><p>测试结果：</p><blockquote><p>IE5.5+ 下返回空字符串</p><p>Chrome3.0+，Firefox3.5，Opera9.6，Safari3.2.2均正常返回来源网页</p></blockquote><p>如果是同个域名下通过此方式跳转的，那么我们可以通过访问windoww.opener对象去获取丢失的referrer信息。代码如下：</p><pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">type</span><span class="kwrd">=&quot;text/javascript&quot;</span><span class="kwrd">&gt;</span>
    <span class="kwrd">var</span> referrer = document.referrer;
    <span class="kwrd">if</span> (!referrer) {
        <span class="kwrd">try</span> {
            <span class="kwrd">if</span> (window.opener) {
                <span class="rem">// IE下如果跨域则抛出权限异常</span>
                <span class="rem">// Safari和Chrome下window.opener.location没有任何属性</span>
                referrer = window.opener.location.href;
            }
        }
        <span class="kwrd">catch</span> (e) {}
    }
<span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span></pre><p>跨域的话则没辙了~</p><h3>鼠标拖拽打开新窗口</h3><p>鼠标拖拽是现在非常流行的用户习惯，很多浏览器都内置或者可以通过插件的方式来支持鼠标拖拽式浏览。但是通过这种方式打开的页面，基本全都丢失referrer。并且，这种情况下，也无法使用window.opener的方式去获取丢失的referrer了。</p><p>已测试：</p><p>Maxthon2.5.2，Firefox的FireGesture插件，Chrome3.0+，Opera9.6，Safari3.2。</p><h3>点击Flash内部链接</h3><p>点击Flash上到达另外一个网站的时候，Referrer的情况就比较杂乱了。</p><p>IE下，通过客户端Javascript的document.referrer读取到的值是空的，但是如果你使用流量监控软件看一下的话，你会发现，实际上HTTP请求中的Referer报文头却是有值的，这可能是IE实现的Bug。同时，这个值指向的是Flash文件的地址，而不是来源网页的地址。</p><p>Chrome4.0下点击Flash到达新窗口之后，Referrer也是指向的Flash文件的地址，而不是源网页的地址。</p><p>Chrome3.0和Safari3.2是一样的，都是会丢失Referrer信息。</p><p>Opera则和Firefox一样，Referrer的值都是来源网页的地址。</p><h3>HTTPS跳转到HTTP</h3><p>从HTTPS的网站跳转到HTTP的网站时，浏览器是不会发送referrer的。这个各大浏览器的行为是一样的。</p><p>例如，我们在HTTPS下使用Google Reader或是Gmail的时候，点击某个链接去到另外一个网站，那么从技术上来说，这样的访问和用户直接键入网址访问是没有什么分别的。</p><h2>Referrer丢失对于广告流量监控的影响</h2><p>Referrer如果丢失，Web Analytics就会丢掉很重要的一部分信息了，特别对于广告流量来说，就无法知道实际来源了。目前国内好多用了Google Adsense广告的网站，都使用了window.open的方式来打开广告链接，因此IE下会丢失Referrer，而我们知道，IE是目前市场份额最大的浏览器，因此其影响是很大的。很多流量统计工具会因此将这部分流量归入“直接流量”，和用户直接键入网址等价了。</p><p>对于这样的情况，需要让广告投放者在投放广告的时候，给着陆页面的Url加上特定的跟踪参数。</p><p>例如，某个Flash广告，点击之后到达的网址是http://www.example.com/，为了监控此流量是从哪个渠道过来的，我们可以修改此投放的着陆Url，改成http://www.example.com/?src=sina，类似这种方式，然后在着陆页面中使用Javascript代码提取此src参数，这样就可以得到广告来源信息。</p><p>在投放Google Adwords的时候，后台系统有一个“自动标记”的选项，当启用此选项的时候，Google在生成所有广告的着陆页面Url的时候，就会自动加上一个gclid的参数，这个参数能够将Google Analytics后台和Adwords广告后台的数据进行整合。这样就可以知道广告流量对应于哪个广告系列，哪个广告来源和广告关键词等信息了。和上面提到的思路其实是类似的。只不过Google自动帮你做了Url的修改了而已。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb24.png" width="244" height="128" /></p><p>如果你发现了其他丢失Referrer的情况，或是你有其他解决方案，欢迎和我交流~</p><p align="right">——<a href="http://www.imkevinyang.com/"><em><strong>Kevin Yang</strong></em></a></p>标签：<a href="http://www.imkevinyang.com/tags/document" title="Document" rel="tag">Document</a>, <a href="http://www.imkevinyang.com/tags/google-analytics" title="Google Analytics" rel="tag">Google Analytics</a>, <a href="http://www.imkevinyang.com/tags/referrer" title="Referrer" rel="tag">Referrer</a>, <a href="http://www.imkevinyang.com/tags/web-analytics" title="Web Analytics" rel="tag">Web Analytics</a>, <a href="http://www.imkevinyang.com/categories/techarticles/webanalytics" title="WebAnalytics" rel="tag">WebAnalytics</a>, <a href="http://www.imkevinyang.com/tags/web%e5%88%86%e6%9e%90" title="Web分析" rel="tag">Web分析</a>, <a href="http://www.imkevinyang.com/tags/%e4%b8%8d%e5%85%bc%e5%ae%b9" title="不兼容" rel="tag">不兼容</a>, <a href="http://www.imkevinyang.com/tags/%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90" title="流量分析" rel="tag">流量分析</a>, <a href="http://www.imkevinyang.com/tags/%e7%a9%ba%e5%ad%97%e7%ac%a6%e4%b8%b2" title="空字符串" rel="tag">空字符串</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2010/01/google-analytics%e4%b8%ad%e7%9a%84page%e7%bb%b4%e5%ba%a6.html" title="Google Analytics中的Page维度 (2010/01/04)">Google Analytics中的Page维度</a> (2010/01/04)</li><li><a href="http://www.imkevinyang.com/2009/03/ie%e4%b8%ad%e4%bd%bf%e7%94%a8windowopen%e6%89%93%e5%bc%80%e6%96%b0%e7%aa%97%e5%8f%a3%e6%97%b6%e6%97%a0%e6%b3%95%e8%8e%b7%e5%8f%96referrer%e5%af%b9%e8%b1%a1.html" title="IE中使用window.open打开新窗口时无法获取Referrer对象 (2009/03/07)">IE中使用window.open打开新窗口时无法获取Referrer对象</a> (2009/03/07)</li><li><a href="http://www.imkevinyang.com/2009/07/javascript-%e4%b8%ad%e7%9a%84false%e9%9b%b6%e5%80%bcnullundefined%e5%92%8c%e7%a9%ba%e5%ad%97%e7%ac%a6%e4%b8%b2%e5%af%b9%e8%b1%a1.html" title="Javascript 中的false,零值,null,undefined和空字符串对象 (2009/07/07)">Javascript 中的false,零值,null,undefined和空字符串对象</a> (2009/07/07)</li><li><a href="http://www.imkevinyang.com/2009/11/%e3%80%90%e6%8e%a8%e8%8d%90%e3%80%91%e4%b8%a4%e6%ac%behttp%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90%e5%b7%a5%e5%85%b7%e7%9a%84%e6%af%94%e8%be%83.html" title="【推荐】两款HTTP流量分析工具的比较 (2009/11/08)">【推荐】两款HTTP流量分析工具的比较</a> (2009/11/08)</li><li><a href="http://www.imkevinyang.com/2010/05/%e5%bd%93google-analytics%e3%80%81firefox%e5%92%8ciis%e8%b5%b0%e5%88%b0%e4%ba%86%e4%b8%80%e8%b5%b7.html" title="当Google Analytics、Firefox和IIS走到了一起&#8230; (2010/05/29)">当Google Analytics、Firefox和IIS走到了一起&#8230;</a> (2010/05/29)</li><li><a href="http://www.imkevinyang.com/2010/01/%e9%ab%98%e6%95%88%e4%bd%bf%e7%94%a8google-analytics%e8%bf%9b%e8%a1%8cweb%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90.html" title="高效使用Google Analytics进行Web流量分析 (2010/01/02)">高效使用Google Analytics进行Web流量分析</a> (2010/01/02)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2010/01/document-referrer%e4%b8%a2%e5%a4%b1%e7%9a%84%e5%87%a0%e4%b8%aa%e5%8e%9f%e5%9b%a0.html/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Google Analytics中的Page维度</title><link>http://www.imkevinyang.com/2010/01/google-analytics%e4%b8%ad%e7%9a%84page%e7%bb%b4%e5%ba%a6.html</link> <comments>http://www.imkevinyang.com/2010/01/google-analytics%e4%b8%ad%e7%9a%84page%e7%bb%b4%e5%ba%a6.html#comments</comments> <pubDate>Sun, 03 Jan 2010 18:08:00 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[WebAnalytics]]></category> <category><![CDATA[Google Analytics]]></category> <category><![CDATA[Page]]></category> <category><![CDATA[维度]]></category> <category><![CDATA[高级群体]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2010/01/google-analytics%e4%b8%ad%e7%9a%84page%e7%bb%b4%e5%ba%a6.html</guid> <description><![CDATA[<p>Google Analytics中的Page维度非常奇怪，在不同场合中使用的时候有不同的意思。</p><p>为了说明这个区别，我引用之前一篇文章《<a title="Google Analytics中的UniquePageView和Visit的区别" href="http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html" target="_blank">Google Analytics中的UniquePageView和Visit的区别</a>》中的实验数据。</p><h2>实验步骤</h2><p>我在自己的网站上放了三个很特殊的静态页面，并加上了ga的代码，这样可以排除其他不必要的干扰。</p><ul><li>gatestpage_a.html</li><li>gatestpage_b.html</li><li>gatestpage_c.html</li></ul><p>实验的几点说&#8230;</p>]]></description> <content:encoded><![CDATA[<p>Google Analytics中的Page维度非常奇怪，在不同场合中使用的时候有不同的意思。</p><p>为了说明这个区别，我引用之前一篇文章《<a title="Google Analytics中的UniquePageView和Visit的区别" href="http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html" target="_blank">Google Analytics中的UniquePageView和Visit的区别</a>》中的实验数据。</p><h2>实验步骤</h2><p>我在自己的网站上放了三个很特殊的静态页面，并加上了ga的代码，这样可以排除其他不必要的干扰。</p><ul><li>gatestpage_a.html</li><li>gatestpage_b.html</li><li>gatestpage_c.html</li></ul><p>实验的几点说明：</p><ul><li>为了模拟不同用户访问我的网站，我会清除掉所有的Cookie</li><li>为了模拟同个用户的不同会话，我会重启浏览器</li><li>为了保证数据能够成功发送到Google服务器，我使用HTTP Watch来监视所有发送的数据</li></ul><p>测试访问记录（测试时间2009-12-06 21:40）：</p><ul><li>用户A&#160; 会话1&#160; <font color="#ff0000">gatestpage_a.html</font>&#160;</li><li>用户A&#160; 会话1&#160; <font color="#008000">gatestpage_b.html</font>&#160;</li><li>用户A&#160; 会话1&#160; <font color="#008000">gatestpage_b.html</font></li><li>用户A&#160; 会话1&#160; <font color="#0000ff">gatestpage_c.html</font>&#160;</li><li>用户A&#160; 会话2&#160; <font color="#ff0000">gatestpage_a.html</font>&#160;</li><li>用户A&#160; 会话2&#160; <font color="#0000ff">gatestpage_c.html</font>&#160;</li><li>用户B&#160; 会话3&#160; <font color="#ff0000">gatestpage_a.html</font></li><li>用户B&#160; 会话3&#160; <font color="#ff0000">gatestpage_a.html</font>&#160;&#160;</li><li>用户C&#160; 会话4&#160; <font color="#ff0000">gatestpage_a.html</font>&#160;</li><li>用户C&#160; 会话4&#160; <font color="#008000">gatestpage_b.html</font></li><li>用户C&#160; 会话5&#160; <font color="#0000ff">gatestpage_c.html</font></li></ul><h2>报表观察</h2><h3>热门内容（Top Content）报表中的Page维度</h3><p>我们先来看热门内容报表中用到的Page维度。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb18.png" width="244" height="135" /></p><p>从上面的报表中的pageview数据来看，这里的页面应该指的是所有页面的访问情况。PageView指的是页面被访问的次数，包括重复访问，而UniquePageView则剔除了重复访问的成分，一次会话只计一次，这和Visit的定义是一样的。</p><h3>自定义报表（Custom Reporting）中的Page维度</h3><p>上面的热门内容报表中的指标是针对单个页面的，如果我们从Page维度来看访问量（Visit）指标，结果又是怎样呢？为此，我创建了一个自定义报表。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb19.png" width="244" height="128" /></p><p>非常简单，只有一个维度和一个指标。报表汇总结果如下：</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb20.png" width="481" height="101" /></p><p>我们可以看到，这里只列出了两个页面，gatestpage_a.html和gatestpage_c.html。这两个页面有什么特别的呢？我们回去看一下实验的步骤，发现，这两个页面均是曾经“担任”过着陆页面的角色。也就是说，在这里，我们报表中选择的“页面维度”不是列出所有页面，而是列出所有着陆页面。后面的visit指标则代表着某个页面作为着陆页面的会话数。</p><h3>高级群体中的Page维度</h3><p>在高级群体中，也有一个Page维度，这又是代表什么意思呢？是所有页面还是着陆页面呢？还是其他？为此我创建了一个高级群体，仅包含一个条件，Page精确匹配/gatestpage_b.html。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb21.png" width="299" height="64" /></p><p>我们回到热门内容报表中，应用此高级群体。理所当然的我们可能会认为报表中只会列出b页面的数据。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb22.png" width="244" height="176" /></p><p>但是我们看到，报表并不是只列出了b页面的数据，其他页面的数据也有，只不过发生了一些差异。我们回过头去对比一下这里的数据和上面写的实验步骤，我们就可以得出结论，这时候看的内容，<strong><font color="#008000">其实是b页面和b页面相关页面的报表</font></strong>。</p><p>如果用户没看过或者不理解我之前<a title="Google Analytics中的UniquePageView和Visit的区别" href="http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html" target="_blank">文章</a>中提到的高级群体的过滤方式的话，那么可能不会容易理解这里看到的数据。</p><p>我们再将此高级群体应用在之前创建的自定义报表上面：</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb23.png" width="418" height="71" /></p><p>我们看到，报表中只列出了gatestpage_a.html页面，visits数据为2。对比实验步骤，我们就知道，这里看的内容，是<strong><font color="#008000">访问过b页面的所有会话的着陆页面报表</font></strong>。</p><p>也就是说，在高级群体这里的“页面维度”，实际上也是代表“所有页面”的意思。</p><p>希望此文章能够帮你更好的理解Google Analytics工具。</p><p align="right">——<a href="http://www.imkevinyang.com/"><em><strong>Kevin Yang</strong></em></a></p>标签：<a href="http://www.imkevinyang.com/tags/google-analytics" title="Google Analytics" rel="tag">Google Analytics</a>, <a href="http://www.imkevinyang.com/tags/page" title="Page" rel="tag">Page</a>, <a href="http://www.imkevinyang.com/categories/techarticles/webanalytics" title="WebAnalytics" rel="tag">WebAnalytics</a>, <a href="http://www.imkevinyang.com/tags/%e7%bb%b4%e5%ba%a6" title="维度" rel="tag">维度</a>, <a href="http://www.imkevinyang.com/tags/%e9%ab%98%e7%ba%a7%e7%be%a4%e4%bd%93" title="高级群体" rel="tag">高级群体</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2010/04/analysis-services%ef%bc%9a%e4%bd%a0%e5%ba%94%e8%af%a5%e4%bd%bf%e7%94%a8%e5%a4%9a%e5%af%b9%e5%a4%9a%e7%bb%b4%e5%ba%a6%e5%90%97%ef%bc%9f.html" title="Analysis Services：你应该使用多对多维度吗？ (2010/04/12)">Analysis Services：你应该使用多对多维度吗？</a> (2010/04/12)</li><li><a href="http://www.imkevinyang.com/2009/03/bids%e5%af%b9%e4%ba%8e%e7%bb%b4%e5%ba%a6%e5%b1%9e%e6%80%a7%e9%94%ae%e4%b8%ba%e5%8f%af%e5%8f%98%e9%95%bf%e5%88%97%e6%97%b6%e5%ad%98%e5%9c%a8%e7%9a%84bug.html" title="BIDS对于维度属性键为可变长列时存在的Bug (2009/03/22)">BIDS对于维度属性键为可变长列时存在的Bug</a> (2009/03/22)</li><li><a href="http://www.imkevinyang.com/2010/01/document-referrer%e4%b8%a2%e5%a4%b1%e7%9a%84%e5%87%a0%e4%b8%aa%e5%8e%9f%e5%9b%a0.html" title="Document.Referrer丢失的几个原因 (2010/01/18)">Document.Referrer丢失的几个原因</a> (2010/01/18)</li><li><a href="http://www.imkevinyang.com/2010/05/%e5%bd%93google-analytics%e3%80%81firefox%e5%92%8ciis%e8%b5%b0%e5%88%b0%e4%ba%86%e4%b8%80%e8%b5%b7.html" title="当Google Analytics、Firefox和IIS走到了一起&#8230; (2010/05/29)">当Google Analytics、Firefox和IIS走到了一起&#8230;</a> (2010/05/29)</li><li><a href="http://www.imkevinyang.com/2009/09/%e8%a7%a3%e5%86%b3%e7%bb%b4%e5%ba%a6%e6%88%90%e5%91%98%e4%b8%ad%e7%9a%84%e9%9d%9e%e6%b3%95xml%e5%ad%97%e7%ac%a6%e5%af%bc%e8%87%b4%e7%9a%84%e6%9f%a5%e8%af%a2%e9%94%99%e8%af%af-2.html" title="解决维度成员中的非法Xml字符导致的查询错误 (2009/09/19)">解决维度成员中的非法Xml字符导致的查询错误</a> (2009/09/19)</li><li><a href="http://www.imkevinyang.com/2010/01/%e9%ab%98%e6%95%88%e4%bd%bf%e7%94%a8google-analytics%e8%bf%9b%e8%a1%8cweb%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90.html" title="高效使用Google Analytics进行Web流量分析 (2010/01/02)">高效使用Google Analytics进行Web流量分析</a> (2010/01/02)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2010/01/google-analytics%e4%b8%ad%e7%9a%84page%e7%bb%b4%e5%ba%a6.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>高效使用Google Analytics进行Web流量分析</title><link>http://www.imkevinyang.com/2010/01/%e9%ab%98%e6%95%88%e4%bd%bf%e7%94%a8google-analytics%e8%bf%9b%e8%a1%8cweb%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90.html</link> <comments>http://www.imkevinyang.com/2010/01/%e9%ab%98%e6%95%88%e4%bd%bf%e7%94%a8google-analytics%e8%bf%9b%e8%a1%8cweb%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90.html#comments</comments> <pubDate>Sat, 02 Jan 2010 06:29:00 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[WebAnalytics]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[Google Analytics]]></category> <category><![CDATA[Web分析]]></category> <category><![CDATA[报表]]></category> <category><![CDATA[数据筛选]]></category> <category><![CDATA[流量分析]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2010/01/%e9%ab%98%e6%95%88%e4%bd%bf%e7%94%a8google-analytics%e8%bf%9b%e8%a1%8cweb%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90.html</guid> <description><![CDATA[<h2>Web流量分析的重要性</h2><p>网站流量分析对于互联网企业来说非常重要。网站技术人员需要数据来告诉他用户对本网站的反馈，进而对网站页面内容以及业务流程进行改版；市场营销人员需要数据来帮助他量化不同渠道的广告效果进而调整媒体广告的投放策略，而老板呢，他可能仅仅想了解互联网是怎么给他带来收益的。</p><p>互联网企业与传统企业最大的一个不同点在于，企业和用户之间并不是面对面交流的。用户来到你的网站，你看不到他在干什么，你不知道他有什么想法。Web流量分析之所以重&#8230;</p>]]></description> <content:encoded><![CDATA[<h2>Web流量分析的重要性</h2><p>网站流量分析对于互联网企业来说非常重要。网站技术人员需要数据来告诉他用户对本网站的反馈，进而对网站页面内容以及业务流程进行改版；市场营销人员需要数据来帮助他量化不同渠道的广告效果进而调整媒体广告的投放策略，而老板呢，他可能仅仅想了解互联网是怎么给他带来收益的。</p><p>互联网企业与传统企业最大的一个不同点在于，企业和用户之间并不是面对面交流的。用户来到你的网站，你看不到他在干什么，你不知道他有什么想法。Web流量分析之所以重要，是因为Web流量分析能够帮你把Web上的未知变成已知，用数据描绘出用户的想法，进而用来支撑你做出的决策。</p><h2>Web流量分析流程</h2><p>Web流量分析要做的事情非常简单，收集所有网站流量数据，根据某一类特征筛选出你关心的那部分流量，分析此流量的性能指标，综合对比其他流量，然后做出决策。下面的图示很好的说明了这一点。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Web流量分析流程" border="0" alt="Web流量分析流程" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb.png" width="333" height="149" /></p><p>目前市面上已经有很多Web流量分析工具了，他们之间除了收集数据的完整程度不同之外，最大的区别就在于能不能帮助你快速筛选出你想看的数据。Google Analytics是免费甚至收费流量统计工具中功能非常强大的一款。它提供了很多数据筛选和分析手段，高效使用这些手段，能够帮你将流量数据的利用率最大化。</p><h2>Google Analytics中的六大数据分析手段</h2><h3>内置报表</h3><p>Web流量分析通常需要回答以下4个基本问题：</p><ul><li>访客特征——谁访问了你的网站</li><li>访客来源——他们从哪里来到你的网站</li><li>访客行为——他们到达你的网站之后都做了什么</li><li>访客质量——他们是否完成了你预期的目标（KPI转化）</li></ul><p>Google Analytics中预置了很多常用的报表，涵盖了上述4个基本问题，可以满足大部分人的常规需求。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Google Analytics内置报表" border="0" alt="Google Analytics内置报表" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb1.png" width="198" height="189" /></p><p>访问者类型的报表可以告诉你的，你的用户都喜欢使用什么样的浏览器访问你的网站，你的用户都是哪些国家省市的，新老用户各占多少比例，他们访问有多频繁，等等。</p><p>流量来源类型的报表可以告诉你，你的用户群中直接键入网址（或者通过收藏夹）、通过推介网站还有搜索引擎来的各占多少比重，付费和免费的流量各是多少，用户搜索什么词来到你的网站的，等等。</p><p>内容类型的报表则告诉你，你的用户来到你网站之后都喜欢看哪些页面，他们喜欢点页面上的哪些链接，他们在你网站上搜索什么（如果你的网站有站内搜索的话），他们还做什么其他什么操作（事件跟踪），等等。</p><p>目标类型的报表则告诉你，用户最终有没有达到你的期望行为，例如停留时间超过10分钟，成功注册了会员身份，在你网站上购买了商品，等等。</p><p>如果你的网站是电子商务类的网站，那么还有专门针对商品信息的报表。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="热门页面" border="0" alt="热门页面" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb2.png" width="304" height="209" /></p><p>熟悉内置的各类报表的意义，能够使你快速了解你的用户群。</p><h3>自定义报表</h3><p>内置报表有时候和我们最终想要的报表有些偏差，例如少了某个我特别关心的指标，或者剖析路径不是我期望的，这个时候，自定义报告就很有用了。</p><p>&#160;<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="自定义报表" border="0" alt="自定义报表" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb3.png" width="229" height="181" /></p><p>自定义报表能够让你选择你关注的指标以及想分析的维度，这样你就不用受限于内置报表了。</p><p>不过，GA中维度和指标之间是有一定的约束关系的，也就是说，你并不是真的可以选择任意维度和指标的组合来生成最终报表。例如当我们选择了指标“唯一身份综合访问量”的时候，我们就不能再选择“跳出率”指标了，选择“网页”维度就无法选择“广告内容”、“安插广告”等维度了。这个可能是和GA后台架构的设计有关。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="自定义报告指标选择限制" border="0" alt="自定义报告指标选择限制" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb4.png" width="244" height="150" /> <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="自定义报告维度选择限制" border="0" alt="自定义报告维度选择限制" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb5.png" width="300" height="60" /></p><h3>快速过滤器</h3><p>当我们看报表的时候，有些维度可能下面成员（指标、维度、成员，这些都是商业智能方面的专业术语，你可以把成员理解为一个一个的条目即可）数目非常多，例如看“热门内容”报表的时候，会列出非常多的网页。例如像我这么小的博客，用户访问过的独立页面就有590个.</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="页面数目" border="0" alt="页面数目" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb6.png" width="244" height="49" /></p><p>如果需要快速从这590个网页中定位到自己想看的内容，那么我们可以应用每个报表底部的快速过滤器。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="快速过滤器" border="0" alt="快速过滤器" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb7.png" width="244" height="226" /></p><p>我们可以输入过滤的字符串，“visual-studio”</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="快速过滤报表结果" border="0" alt="快速过滤报表结果" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb8.png" width="244" height="176" /></p><p>需要注意的是，<strong><font color="#008000">这里快速过滤器要求输入一个正则表达式</font></strong>。大多数人可能不知道这一点。特别是当你尝试过滤Url的时候，你很可能会输入带问号的过滤字符串，例如“search?q=cache”，你期望过滤出Google缓存页面的Url，结果出现：</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="过滤之后无数据" border="0" alt="过滤之后无数据" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb9.png" width="244" height="65" /></p><p>这是因为？号是正则表达式中的特殊符号，不能直接这样使用。</p><p>当你输入一个非法的正则表达式的时候，GA会提示你</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="过滤文字不是有效正则表达式" border="0" alt="过滤文字不是有效正则表达式" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb10.png" width="244" height="22" /></p><p>可能这个时候你才会意识到这里支持的是正则表达式，而不能输入普通的文本。</p><p>之前一个同事要我给他定制一份每日热门内容报表，但他要求只看某些特定页面的数据。例如：</p><ul><li>/products.asp?columnid=253</li><li>/products.asp?columnid=254</li><li>/products.asp?columnid=255</li><li>/products.asp?columnid=258</li><li>/products.asp?columnid=1053</li><li>/templates/products.asp</li></ul><p>列表太长了，我就不全部列出来，要在热门内容报表中过滤出一批特定页面的数据来，最简单的做法，就是通过这里的快速过滤器，写一个正则表达式涵盖上述这些特定页面。</p><p>(/products.asp?columnid=(253|254|255|258|1053))|(/templates/products.asp)</p><h3>高级过滤器</h3><p>在报表底部的快速过滤器一栏，我们还可以看到有个“高级过滤器”的按钮，这是GA在09年加入的新功能。点开“高级过滤器”，你可以看到以下编辑界面：</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="高级过滤器" border="0" alt="高级过滤器" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb11.png" width="295" height="198" /></p><p>高级过滤器有什么高级之处呢？在这里，你除了可以对维度成员进行过滤（就像上一节讲到的快速过滤器一样）之外，你还可以<strong><font color="#008000">根据当前报表中的指标进行条件筛选</font></strong>。例如，你想看包含“正则”字符串、并且跳出率小于30%的所有用户搜索关键词，那么你可以按照上图中的设置去过滤。</p><h3>高级群体</h3><p>上述的快速过滤器和高级过滤器只能应用在当前报表中，也就是说当你切换到另外一张报表的时候，过滤器就失效了，如果你需要在各个报表中共享此过滤条件的话，那么你可以使用“高级群体”特性。</p><p>高级群体的界面和上面一节中说的高级过滤器类似。你可以选择维度作为过滤条件，也可以选择指标作为过滤条件。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="高级群体" border="0" alt="高级群体" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb12.png" width="364" height="264" />&#160;</p><p>只不过在这里，你可以使用的条件更多，不用受限于你所看的报表。上一节中讲到的快速高级过滤器中，你只能针对当前报表中用到的维度和指标进行过滤，并且过滤条件之间都是And的关系，无法指定更灵活的逻辑关系。在高级群体设置中，你可以使用or和and来构造你想要的逻辑表达式。</p><p>但是高级群体和上述过滤器在过滤数据的方式上还有一个非常大的区别，如果你不理解这个区别的话，那么你很容易对过滤之后得到的报表产生迷惑。</p><p><strong><font color="#008000">在上面的快速高级过滤器中，我们的过滤条件都是针对每个维度成员</font></strong>，例如浏览器维度的firefox、ie6、ie8等成员，这里过滤的手段是，遍历每一个维度成员，然后判断每个维度成员的名称是否符合用户设置的维度条件，例如关键词维度成员中含有“silverlight”字符串的；或者，判断每个维度成员的某个指标是否符合用户设置的指标条件，例如关键词维度成员中跳出率小于50%，停留时间&gt;10秒的，等等。</p><p><strong><font color="#008000">而在高级群体中，我们的过滤条件都是针对每个会话的</font></strong>。页面访问（PageView），会话（Session）和访客（Visitor）是Web分析的三大核心概念。这里不做特殊解释，如果有不清楚的，可以参考GA帮助文档。高级群体过滤的手段是，遍历所有的会话，然后判断会话的特定维度是否符合用户设置的维度条件，或者，判断单个会话的指标是否符合用户设置的指标条件。</p><p>例如找出所有浏览器名称包含“ie”字符串的会话，或者停留时间&gt;10秒的会话，等等。一定要注意，这里针对的是会话。当你使用此高级群体看报表的时候，实际上会先选出符合条件的所有会话，然后在这些会话的基础上进行报表的汇总。下图展示了高级过滤器（快速过滤器也是类似的）和高级群体在过滤上的不同。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="高级过滤器" border="0" alt="高级过滤器" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb13.png" width="517" height="119" /></p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="高级群体" border="0" alt="高级群体" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb14.png" width="518" height="144" /></p><h3>配置文件数据过滤器</h3><p>上述说到的几种数据过滤方式都是针对报表的，你所做的任何过滤手段都不会影响底层的数据。而在配置文件级别上设置的过滤器，是会真正影响底层数据。Google在将数据导入到数据仓库之前会先应用这里设置的各种过滤器。过滤器主要有两个作用：</p><p>1. 决定数据的取舍</p><p>2. 修改数据</p><p>数据取舍指的是根据用户设定的一系列条件来决定数据是否展示给最终用户。你可以使用GA预定义的常用过滤器，例如排除来自某个特定IP的流量，仅包含某个特定域的流量，等等。你可以用它来过滤掉垃圾流量。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="预定义的过滤器" border="0" alt="预定义的过滤器" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb15.png" width="244" height="116" /></p><p>如果预定义的过滤器不能满足你的需求，那么你可以使用自定义过滤器。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="自定义过滤器" border="0" alt="自定义过滤器" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb16.png" width="244" height="232" /></p><p>在这里，Google直接把底层各种数据字段暴露出来，你可以选择任意一个字段，例如用户请求的Url，然后写一个正则表达式进行模式匹配。满足要求的，你可以选择保留下来或者排除在外。</p><p>GA不但允许你筛选数据，还允许你修改或者合并数据。例如请求Url中可能包含了一些GA无法识别的广告跟踪参数，这样看热门内容报表的时候，同一个页面就会显示为多个Url，这不是我们期望看到的。那么我们可以使用上图中自定义过滤器的“搜索和替换”选项。选择“请求URI”，然后写正则表达式将此跟踪参数替换成空字符串即可。</p><p>又或者，我们可能希望取几个不同字段中的部分内容，然后将其拼接成一个新的字段。那么你可以使用上图中自定义过滤器的“高级”选项。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="自定义过滤器高级选项" border="0" alt="自定义过滤器高级选项" src="http://www.imkevinyang.com/wp-content/uploads/2010/01/image_thumb17.png" width="244" height="214" /></p><p>在上图中，我将访客的操作系统和浏览器合并到“浏览器”字段中，这样，以后我看“浏览器”报表的时候，就不是看到ie6，ie7这样的数据了，而是看到&quot;Windows xp : ie6”,&quot;linux:firefox”这样的数据。</p><p>注意，在配置文件上设置的过滤器，只会影响新数据，旧数据不会受此影响。</p><p>在配置文件上新建的过滤器非常适用于创建数据的不同视图。例如，我有三个域名（同一个根域），上面埋的GA代码都是一样的，但是不同域可能由不同的同事来负责，因此你可以新建三个一样的配置文件（创建的时候，选择从已有的域中创建，这样新的配置文件就和旧的配置文件使用同一份跟踪代码），然后应用不同的过滤器，这样看到的数据就不一样了。</p><p>&#160;</p><p>OK，Google的几大特色数据过滤功能都已经介绍完毕，希望对那些还不熟悉Google Analytics的人能有所启发。如果你使用Google Analytics有什么其他心得，也欢迎大家一块交流~</p><p align="right">——<a href="http://www.imkevinyang.com/"><em><strong>Kevin Yang</strong></em></a></p>标签：<a href="http://www.imkevinyang.com/tags/google" title="Google" rel="tag">Google</a>, <a href="http://www.imkevinyang.com/tags/google-analytics" title="Google Analytics" rel="tag">Google Analytics</a>, <a href="http://www.imkevinyang.com/categories/techarticles/webanalytics" title="WebAnalytics" rel="tag">WebAnalytics</a>, <a href="http://www.imkevinyang.com/tags/web%e5%88%86%e6%9e%90" title="Web分析" rel="tag">Web分析</a>, <a href="http://www.imkevinyang.com/tags/%e6%8a%a5%e8%a1%a8" title="报表" rel="tag">报表</a>, <a href="http://www.imkevinyang.com/tags/%e6%95%b0%e6%8d%ae%e7%ad%9b%e9%80%89" title="数据筛选" rel="tag">数据筛选</a>, <a href="http://www.imkevinyang.com/tags/%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90" title="流量分析" rel="tag">流量分析</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/08/4%e8%a1%8cgreasemonkey%e4%bb%a3%e7%a0%81%e6%9c%80%e5%a4%a7%e5%8c%96google-reader%e7%9a%84%e9%98%85%e8%af%bb%e7%a9%ba%e9%97%b4.html" title="4行Greasemonkey代码最大化Google Reader的阅读空间 (2009/08/09)">4行Greasemonkey代码最大化Google Reader的阅读空间</a> (2009/08/09)</li><li><a href="http://www.imkevinyang.com/2010/03/android%e6%89%8b%e6%9c%ba%e5%88%9d%e4%bd%93%e9%aa%8c.html" title="Android手机初体验 (2010/03/01)">Android手机初体验</a> (2010/03/01)</li><li><a href="http://www.imkevinyang.com/2010/01/document-referrer%e4%b8%a2%e5%a4%b1%e7%9a%84%e5%87%a0%e4%b8%aa%e5%8e%9f%e5%9b%a0.html" title="Document.Referrer丢失的几个原因 (2010/01/18)">Document.Referrer丢失的几个原因</a> (2010/01/18)</li><li><a href="http://www.imkevinyang.com/2010/03/g1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html" title="G1手机与笔记本实现Wifi互联共享上网 (2010/03/02)">G1手机与笔记本实现Wifi互联共享上网</a> (2010/03/02)</li><li><a href="http://www.imkevinyang.com/2010/01/google-analytics%e4%b8%ad%e7%9a%84page%e7%bb%b4%e5%ba%a6.html" title="Google Analytics中的Page维度 (2010/01/04)">Google Analytics中的Page维度</a> (2010/01/04)</li><li><a href="http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html" title="Google Analytics中的UniquePageView和Visits的区别 (2009/12/07)">Google Analytics中的UniquePageView和Visits的区别</a> (2009/12/07)</li><li><a href="http://www.imkevinyang.com/2009/11/google-wave%e4%b8%ba%e4%bb%80%e4%b9%88%e8%bf%99%e4%b9%88%e7%81%ab.html" title="Google Wave为什么这么火 (2009/11/14)">Google Wave为什么这么火</a> (2009/11/14)</li><li><a href="http://www.imkevinyang.com/2009/05/google%e5%92%8c%e5%be%ae%e8%bd%af%e7%9a%84%e4%b8%80%e5%a4%a7%e4%b8%8d%e5%90%8c.html" title="Google和微软的一大不同 (2009/05/06)">Google和微软的一大不同</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e6%8e%92%e5%90%8d%e6%9b%b4%e6%96%b0.html" title="Google排名更新 (2009/03/21)">Google排名更新</a> (2009/03/21)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2010/01/%e9%ab%98%e6%95%88%e4%bd%bf%e7%94%a8google-analytics%e8%bf%9b%e8%a1%8cweb%e6%b5%81%e9%87%8f%e5%88%86%e6%9e%90.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Google Analytics中的UniquePageView和Visits的区别</title><link>http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html</link> <comments>http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html#comments</comments> <pubDate>Mon, 07 Dec 2009 06:23:00 +0000</pubDate> <dc:creator>Kevin Yang</dc:creator> <category><![CDATA[WebAnalytics]]></category> <category><![CDATA[GA]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[GoogleAnalytics]]></category> <category><![CDATA[pageview]]></category> <category><![CDATA[UniquePageview]]></category> <category><![CDATA[visit]]></category> <category><![CDATA[概念]]></category><guid isPermaLink="false">http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html</guid> <description><![CDATA[<p>Google Analytics中对UniquePageView是这样解释的：</p><blockquote><p>A unique view, as seen in the <em>Top Content</em> report, aggregates pageviews that are generated by the same user during the same session. A unique view represents the number of sessions during which that page was viewed one or&#8230;</p></blockquote>]]></description> <content:encoded><![CDATA[<p>Google Analytics中对UniquePageView是这样解释的：</p><blockquote><p>A unique view, as seen in the <em>Top Content</em> report, aggregates pageviews that are generated by the same user during the same session. A unique view represents the number of sessions during which that page was viewed one or more times.</p></blockquote><p>简单的说，一个页面的UniquePageView（唯一页面访问量）就等于访问过此页面的会话数的总和。假设某个网站有两个页面A和B，访问记录如下：</p><ul><li>2009-12-06 12:00 页面A&#160;&#160;&#160; 用户甲&#160;&#160;&#160; 会话1</li><li>2009-12-06 12:10 页面B&#160;&#160;&#160; 用户甲&#160;&#160;&#160; 会话1</li><li>2009-12-06 12:20 页面A&#160;&#160;&#160; 用户乙&#160;&#160;&#160; 会话2</li><li>2009-12-06 12:30 页面A&#160;&#160;&#160; 用户丙&#160;&#160;&#160; 会话3</li><li>2009-12-07 12:00 页面B&#160;&#160;&#160; 用户甲&#160;&#160;&#160; 会话4</li></ul><p>对于页面A来说，和它相关的会话总共有3个，因此uniquepageview为3，页面B相关的会话有两个，因此UniquePageView为2。那么所有汇总得到的UniquePageView等于多少呢？是3+2=5呢，还是4？</p><p>这里面的核心问题就是，<strong><font color="#008000">同个会话访问了不同页面，Google Analytics是计算两次还是只计算一次</font></strong>。</p><h2>实验出真知</h2><h3>实验步骤</h3><p>为了做这个实验，我在自己的网站上放了三个很特殊的静态页面，并加上了ga的代码，这样可以排除其他不必要的干扰。</p><ul><li>gatestpage_a.html</li><li>gatestpage_b.html</li><li>gatestpage_c.html</li></ul><p>实验的几点说明：</p><ul><li>为了模拟不同用户访问我的网站，我会清除掉所有的Cookie</li><li>为了模拟同个用户的不同会话，我会重启浏览器</li><li>为了保证数据能够成功发送到Google服务器，我使用HTTP Watch来监视所有发送的数据</li></ul><p>测试访问记录（测试时间2009-12-06 21:40）：</p><ul><li>用户A&#160; 会话1&#160; <font color="#ff0000">gatestpage_a.html</font>&#160;</li><li>用户A&#160; 会话1&#160; <font color="#008000">gatestpage_b.html</font>&#160;</li><li>用户A&#160; 会话1&#160; <font color="#008000">gatestpage_b.html</font></li><li>用户A&#160; 会话1&#160; <font color="#0000ff">gatestpage_c.html</font>&#160;</li><li>用户A&#160; 会话2&#160; <font color="#ff0000">gatestpage_a.html</font>&#160;</li><li>用户A&#160; 会话2&#160; <font color="#0000ff">gatestpage_c.html</font>&#160;</li><li>用户B&#160; 会话3&#160; <font color="#ff0000">gatestpage_a.html</font></li><li>用户B&#160; 会话3&#160; <font color="#ff0000">gatestpage_a.html</font>&#160;&#160;</li><li>用户C&#160; 会话4&#160; <font color="#ff0000">gatestpage_a.html</font>&#160;</li><li>用户C&#160; 会话4&#160; <font color="#008000">gatestpage_b.html</font></li><li>用户C&#160; 会话5&#160; <font color="#0000ff">gatestpage_c.html</font></li></ul><p>OK，按照上面的访问记录，我们期望的报表应该是：</p><table border="1" cellspacing="0" cellpadding="2" width="550"><thead><tr><td valign="top" width="100">&#160;</td><td valign="top" width="78">pageview</td><td valign="top" width="144">unique pageview</td><td valign="top" width="78">session/visits</td><td valign="top" width="100">visitors</td></tr></thead><tbody><tr><td valign="top" width="100">gatestpage_a.html</td><td valign="top" width="78">5</td><td valign="top" width="144">4</td><td valign="top" width="78">4</td><td valign="top" width="100">3</td></tr><tr><td valign="top" width="100">gatestpage_b.html</td><td valign="top" width="78">3</td><td valign="top" width="144">2</td><td valign="top" width="78">2</td><td valign="top" width="100">2</td></tr><tr><td valign="top" width="100">gatestpage_c.html</td><td valign="top" width="78">3</td><td valign="top" width="144">3</td><td valign="top" width="78">3</td><td valign="top" width="100">2</td></tr><tr><td valign="top" width="100">汇总</td><td valign="top" width="78">11</td><td valign="top" width="144"><font color="#ff0000">????</font></td><td valign="top" width="78">5</td><td valign="top" width="100">3</td></tr></tbody></table><p>暂时我们不确定的就是汇总之后的UniquePageView了。</p><h3>测试结果</h3><p>在Google Analytics后台，我创建了两张自定义报表，分别用于查看PageView相关的指标和Session相关的指标（Google Analytics不支持在一张报表中同时查看这两类指标）。</p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb13.png" width="425" height="141" /></p><p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2009/12/image_thumb14.png" width="423" height="141" /></p><p>Google它不支持查看单个页面的Visits指标，上图中我们尝试<strong><font color="#008000">从Page维度去看访问量，实际上是看的着陆页面的维度，也就是此页面作为着陆页面的会话数</font></strong>。</p><p>我们将得到的报表整合到一块来看</p><table border="1" cellspacing="0" cellpadding="2" width="550"><thead><tr><td valign="top" width="100">&#160;</td><td valign="top" width="78">pageview</td><td valign="top" width="184">unique pageview</td><td valign="top" width="38">session/visits</td><td valign="top" width="100">visitors</td></tr></thead><tbody><tr><td valign="top" width="100">gatestpage_a.html</td><td valign="top" width="78">5</td><td valign="top" width="184">4</td><td valign="top" width="38">4</td><td valign="top" width="100"><font color="#ff0000">X</font></td></tr><tr><td valign="top" width="100">gatestpage_b.html</td><td valign="top" width="78">3</td><td valign="top" width="184">2</td><td valign="top" width="38">0</td><td valign="top" width="100"><font color="#ff0000">X</font></td></tr><tr><td valign="top" width="100">gatestpage_c.html</td><td valign="top" width="78">3</td><td valign="top" width="184">3</td><td valign="top" width="38">1</td><td valign="top" width="100"><font color="#ff0000">X</font></td></tr><tr><td valign="top" width="100">汇总</td><td valign="top" width="78">11</td><td valign="top" width="184"><font color="#ff0000">9</font></td><td valign="top" width="38">5</td><td valign="top" width="100"><font color="#ff0000">X</font></td></tr></tbody></table><p>从上面的报表我们可以看出，<strong><font color="#008000">UniquePageView的汇总方式是把每个页面的uniquepageview叠加到一块得到的</font></strong>。</p><p>我又查看了手头一些账号的数据，确认了这个结论。不过我之前也做过查看过相应的数据，不过当时的结论和现在的不同。当时的结论是，UniquePageView的汇总至并不总是等于每个page的UniquePageView相加之和，也不等于所有访问量（Vistis），当时觉得非常迷惑。感觉可能GA的UniquePageView本来就是这么设计的，但是当时有Bug，导致查看的时候出现数据不一致的现象。</p><p align="right">——<a href="http://www.imkevinyang.com/"><em><strong>Kevin Yang</strong></em></a></p>标签：<a href="http://www.imkevinyang.com/tags/ga" title="GA" rel="tag">GA</a>, <a href="http://www.imkevinyang.com/tags/google" title="Google" rel="tag">Google</a>, <a href="http://www.imkevinyang.com/tags/googleanalytics" title="GoogleAnalytics" rel="tag">GoogleAnalytics</a>, <a href="http://www.imkevinyang.com/tags/pageview" title="pageview" rel="tag">pageview</a>, <a href="http://www.imkevinyang.com/tags/uniquepageview" title="UniquePageview" rel="tag">UniquePageview</a>, <a href="http://www.imkevinyang.com/tags/visit" title="visit" rel="tag">visit</a>, <a href="http://www.imkevinyang.com/categories/techarticles/webanalytics" title="WebAnalytics" rel="tag">WebAnalytics</a>, <a href="http://www.imkevinyang.com/tags/%e6%a6%82%e5%bf%b5" title="概念" rel="tag">概念</a><br /><h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4><ul class="st-related-posts"><li><a href="http://www.imkevinyang.com/2009/08/4%e8%a1%8cgreasemonkey%e4%bb%a3%e7%a0%81%e6%9c%80%e5%a4%a7%e5%8c%96google-reader%e7%9a%84%e9%98%85%e8%af%bb%e7%a9%ba%e9%97%b4.html" title="4行Greasemonkey代码最大化Google Reader的阅读空间 (2009/08/09)">4行Greasemonkey代码最大化Google Reader的阅读空间</a> (2009/08/09)</li><li><a href="http://www.imkevinyang.com/2010/03/android%e6%89%8b%e6%9c%ba%e5%88%9d%e4%bd%93%e9%aa%8c.html" title="Android手机初体验 (2010/03/01)">Android手机初体验</a> (2010/03/01)</li><li><a href="http://www.imkevinyang.com/2010/03/g1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html" title="G1手机与笔记本实现Wifi互联共享上网 (2010/03/02)">G1手机与笔记本实现Wifi互联共享上网</a> (2010/03/02)</li><li><a href="http://www.imkevinyang.com/2009/11/google-wave%e4%b8%ba%e4%bb%80%e4%b9%88%e8%bf%99%e4%b9%88%e7%81%ab.html" title="Google Wave为什么这么火 (2009/11/14)">Google Wave为什么这么火</a> (2009/11/14)</li><li><a href="http://www.imkevinyang.com/2009/05/google%e5%92%8c%e5%be%ae%e8%bd%af%e7%9a%84%e4%b8%80%e5%a4%a7%e4%b8%8d%e5%90%8c.html" title="Google和微软的一大不同 (2009/05/06)">Google和微软的一大不同</a> (2009/05/06)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> (2009/03/23)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e6%8e%92%e5%90%8d%e6%9b%b4%e6%96%b0.html" title="Google排名更新 (2009/03/21)">Google排名更新</a> (2009/03/21)</li><li><a href="http://www.imkevinyang.com/2009/03/google%e7%9a%84%e4%bb%b7%e5%80%bc%e8%a7%82.html" title="Google的价值观 (2009/03/07)">Google的价值观</a> (2009/03/07)</li><li><a href="http://www.imkevinyang.com/2009/05/php%e5%a4%84%e7%90%86bom%e6%a0%87%e8%ae%b0%e7%9a%84utf-8%e6%96%87%e4%bb%b6%e5%af%bc%e8%87%b4%e7%9a%84%e9%97%ae%e9%a2%98.html" title="PHP处理BOM标记的UTF-8文件导致的问题 (2009/05/05)">PHP处理BOM标记的UTF-8文件导致的问题</a> (2009/05/05)</li><li><a href="http://www.imkevinyang.com/2010/02/%e4%bd%bf%e7%94%a8feedburner%e7%83%a7%e5%88%b6rss%e6%9c%80%e5%a5%bd%e7%a6%81%e7%94%a8itemlinkclicks%e7%bb%9f%e8%ae%a1.html" title="使用FeedBurner烧制RSS最好禁用ItemLinkClicks统计 (2010/02/15)">使用FeedBurner烧制RSS最好禁用ItemLinkClicks统计</a> (2010/02/15)</li></ul>]]></content:encoded> <wfw:commentRss>http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>