<?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>So Marketing &#187; _setAllowAnchor()</title>
	<atom:link href="http://sem.joyit.net/tag/_setallowanchor/feed/" rel="self" type="application/rss+xml" />
	<link>http://sem.joyit.net</link>
	<description>关注网络营销，研究统计技巧</description>
	<lastBuildDate>Wed, 01 Jul 2009 14:33:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>多锚点网页浏览量的跟踪</title>
		<link>http://sem.joyit.net/web-analytics/track-the-webpage-with-multi-anchor/</link>
		<comments>http://sem.joyit.net/web-analytics/track-the-webpage-with-multi-anchor/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 12:44:05 +0000</pubDate>
		<dc:creator>owen</dc:creator>
				<category><![CDATA[网站统计与分析]]></category>
		<category><![CDATA[_setAllowAnchor()]]></category>
		<category><![CDATA[多锚点网页浏览量跟踪]]></category>

		<guid isPermaLink="false">http://sem.joyit.net/?p=158</guid>
		<description><![CDATA[一般的网络统计系统，只能跟踪到页面级的流量，并无法跟踪页面内某个锚点的浏览量。而现在web技术的发展，尤其是ajax的大量应用，用户无需切换页面，即可在当前页面实现内容的切换，这就为精确的页面统计带来一定的难度。 Google Analytics不断创新的跟踪特性，让跟踪页面内内容切换不再无法实现。我们还是以google牛人活动的投票页面为例，来分析google是如何实现对单页内多锚点内容的跟踪。 这个页面不仅有横向的tab切换，还有纵向的抽屉式选项切换。如果是此次活动的主办人员，会希望得到什么数据呢？那就是哪些选项获得比较多的浏览，并且分别来自哪些来源。 一般默认的google analytics代码只能跟踪到页面url，并无法跟踪到页面内各个锚点（id)的浏览数据。 我们来看google的人是如何通过设置google analytics代码，实现对页面内各个锚点的跟踪？ 查看统计源码如下： 我们看到主办方首先是利用了GA的_setCookiePath()函数限定了该页面的GA配置文件仅跟踪此目录下的浏览量（更多说明请见GA说明具体代码看不是很明白，熟悉JS的同学欢迎留言解释一下） 然后，在GA中使用了_setAllowAnchor() 函数，通过使用该函数，使得GA也可以跟踪到各个锚点的浏览量，等于是把各锚点的浏览都当作一个独立的页面来统计。通过这样的设置，在GA的内容报告中，便可了解此次活动的哪些选项（锚点）获得了比较多的浏览量（点击），而这些浏览量又是来自哪些来源。 你可能感兴趣的文章Google Analytics的申请与配置扩展关键词列表的技巧与工具新手福音：Google Analytics更新新手指南与安装向导adwords工具之Get busy living,Or get busy dying © owen 发布于 So Marketing, 2009. &#124; 多锚点网页浏览量的跟踪 &#124; 3 条评论 &#124; 标签: _setAllowAnchor(), 多锚点网页浏览量跟踪]]></description>
			<content:encoded><![CDATA[<p>一般的网络统计系统，只能跟踪到页面级的流量，并无法跟踪页面内某个锚点的浏览量。而现在web技术的发展，尤其是ajax的大量应用，用户无需切换页面，即可在当前页面实现内容的切换，这就为精确的页面统计带来一定的难度。</p>
<p>Google Analytics不断创新的跟踪特性，让跟踪页面内内容切换不再无法实现。我们还是以<a title="给“Google 牛人”投票" href="http://www.google.com/intl/zh-CN/landing/tips/vote.html#t1-11" target="_blank">google牛人活动的投票页面</a>为例，来分析google是如何实现对单页内多锚点内容的跟踪。</p>
<p><a href="http://sem.joyit.net/wp-content/uploads/2009/04/screenshoot.gif" target="_blank"><img class="size-medium wp-image-159 alignnone" title="google牛人活动的投票页面" src="http://sem.joyit.net/wp-content/uploads/2009/04/screenshoot-500x472.gif" alt="google牛人活动的投票页面" width="500" height="472" /></a></p>
<p>这个页面不仅有横向的tab切换，还有纵向的抽屉式选项切换。如果是此次活动的主办人员，会希望得到什么数据呢？那就是哪些选项获得比较多的浏览，并且分别来自哪些来源。</p>
<p><span id="more-158"></span></p>
<p>一般默认的google analytics代码只能跟踪到页面url，并无法跟踪到页面内各个锚点（id)的浏览数据。</p>
<p>我们来看google的人是如何通过设置google analytics代码，实现对页面内各个锚点的跟踪？</p>
<p>查看统计源码如下：</p>
<p><a href="http://sem.joyit.net/wp-content/uploads/2009/04/ga-code.gif" target="_blank"><img class="size-medium wp-image-160 alignnone" title="google牛人页面的GA统计代码" src="http://sem.joyit.net/wp-content/uploads/2009/04/ga-code-500x354.gif" alt="google牛人页面的GA统计代码" width="500" height="354" /></a></p>
<p>我们看到主办方首先是利用了GA的<span class="pln">_setCookiePath()函数限定了该页面的GA配置文件仅跟踪此目录下的浏览量（<a title="Cross-Domain Tracking A default setup of Google Analytics is designed to track content and visitor data for a single domain, such as dogs.example.com or www.example.com.  However, suppose you want to use Analytics for more complex situations, such as tracking  all visitors to both dogs.example.com and www.example.com, with data for both showing in the same report profile  only visitors to the www.example.com/dogs subdirectory in a separate report as if it were a single site  all visitors to two domains that you own, such as www.example.com and www.example2.com, with data for both showing in the same report profile  visitor and pageview data for content in an iFrame of another domain.  In any of these cases, you'll need to do some customization to the tracking code in order to correctly track visitors. Before doing this, it's a good idea to read about Domains and Directories as they are defined in a default Analytics installation.  Use the following table to view sections in the rest of this document, and as a reference for the tracking code modifications suggest for each method. Once you have decided on a tracking method, be sure to also read the Site Linking Considerations at the end of this document.  Type of Tracking Example Domains Configuration Needed  Restricted to a single sub-directory www.example.com/myStore _setCookiePath(&quot;/myStore/&quot;);  Across two sub-directories on the same domain www.example-commerce-host.com/myStore  www.example-commerce-host.com/myCart   _setCookiePath(&quot;/first/Path/&quot;); _cookiePathCopy(&quot;/new/Path/&quot;);  Between a domain and a sub-directory on another domain www.example-petstore.com  www.example-commerce-host.com/petStoreCart   _setDomainName(&quot;none&quot;); _setAllowLinker(enable); _setAllowHash(false); _link(); _linkByPost();  Across a domain and its sub-domains www.example-petstore.com  dogs.example-petstore.com  cats.example-petstore.com   _setDomainName(&quot;.example-petstore.com&quot;); _setAllowHash(false);  Across multiple domains and/or sub-domains www.example-petstore.com  www.my-example-blogsite.com  dogs.example-petstore.com   _setDomainName(&quot;none&quot;); _setAllowLinker(enable); _setAllowHash(&quot;false&quot;); _link(); _linkByPost();  Tracking an iFrame hosted in another domain www.example-parent.com  www.my-example-iframecontent.com   iframe.src = pageTracker._getLinkerUrl(&quot;http://www.my-example-content.com&quot;);    Back to Top Restricting Tracking to a Single Subdirectory" href="http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html#singleSubDirectory" target="_blank">更多说明请见GA说明</a>具体代码看不是很明白，熟悉JS的同学欢迎留言解释一下）</span></p>
<p><span class="pln">然后，在GA中使用了</span><a title="Google Analytics setAllowAnchor()" href="http://code.google.com/apis/analytics/docs/gaJS/gaJSApiCampaignTracking.html#_gat.GA_Tracker_._setAllowAnchor">_setAllowAnchor() </a>函数，通过使用该函数，使得GA也可以跟踪到各个锚点的浏览量，等于是把各锚点的浏览都当作一个独立的页面来统计。通过这样的设置，在<strong>GA的内容报告</strong>中，便可了解此次活动的哪些选项（锚点）获得了比较多的浏览量（点击），而这些浏览量又是来自哪些来源。</p>
<h4  class="related_post_title">你可能感兴趣的文章</h4><ul class="related_post"><li><a href="http://sem.joyit.net/web-analytics/tips-for-tracking-email-marketing-campaigns/" title="如何用GA utm跟踪邮件营销活动(翻译)">如何用GA utm跟踪邮件营销活动(翻译)</a></li><li><a href="http://sem.joyit.net/web-marketing/start/" title="Get busy living,Or get busy dying">Get busy living,Or get busy dying</a></li><li><a href="http://sem.joyit.net/web-marketing/fake-traffic/" title="那些虚无缥缈的流量">那些虚无缥缈的流量</a></li><li><a href="http://sem.joyit.net/baidu-jingjia/baidu-zuanyeban-by-ga/" title="如何用GA监测百度竞价专业版的广告效果">如何用GA监测百度竞价专业版的广告效果</a></li><li><a href="http://sem.joyit.net/baidu-jingjia/baidu-content-networks-will-launch/" title="百度内容网络即将公布">百度内容网络即将公布</a></li></ul><hr />
<p>© owen 发布于 <a href="http://sem.joyit.net">So Marketing</a>, 2009. |
<a href="http://sem.joyit.net/web-analytics/track-the-webpage-with-multi-anchor/">多锚点网页浏览量的跟踪</a> |
<a href="http://sem.joyit.net/web-analytics/track-the-webpage-with-multi-anchor/#comments">3 条评论</a> |
<img src="http://img.tongji.linezing.com/1043888/tongji.gif"/>
<br/>
标签: <a href="http://sem.joyit.net/tag/_setallowanchor/" rel="tag">_setAllowAnchor()</a>, <a href="http://sem.joyit.net/tag/%e5%a4%9a%e9%94%9a%e7%82%b9%e7%bd%91%e9%a1%b5%e6%b5%8f%e8%a7%88%e9%87%8f%e8%b7%9f%e8%b8%aa/" rel="tag">多锚点网页浏览量跟踪</a><br/>
<a href="http://inezha.com/add?url=http://feed.feedsky.com/somarketing"><img border="0" src="http://img.feedsky.com/images/icon_subshot02_nazha.gif" alt="哪吒" vspace="2" style="margin-bottom:3px" ></a> 
<a href="http://mail.qq.com/cgi-bin/feed?u=http://feed.feedsky.com/somarketing"><img border="0" src="http://img.feedsky.com/images/icon_subshot02_qq.gif" alt="QQ邮箱" vspace="2" style="margin-bottom:3px" ></a> 
<a href="http://9.douban.com/reader/subscribe?url=http://feed.feedsky.com/somarketing"><img border="0" src="http://img.feedsky.com/images/icon_subshot02_douban.gif" alt="九点" vspace="2" style="margin-bottom:3px" ></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://sem.joyit.net/web-analytics/track-the-webpage-with-multi-anchor/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
