<?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>SEM KNOWLEDGE BASE&#124;搜索营销智库&#187; 老菜鸟</title>
	<atom:link href="http://www.adsem.org/author/george/feed" rel="self" type="application/rss+xml" />
	<link>http://www.adsem.org</link>
	<description>搜索营销行业营销实践</description>
	<lastBuildDate>Mon, 09 Jan 2012 07:27:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Google Analytics自定义变量（Custom Variables）应用两例</title>
		<link>http://www.adsem.org/163</link>
		<comments>http://www.adsem.org/163#comments</comments>
		<pubDate>Wed, 19 May 2010 08:08:34 +0000</pubDate>
		<dc:creator>老菜鸟</dc:creator>
				<category><![CDATA[网站分析]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[谷歌分析]]></category>

		<guid isPermaLink="false">http://www.adsem.org/?p=163</guid>
		<description><![CDATA[自定义变量 （Custom Variables）是Google Analytics 2009年10月推出的一个功能，可以用来对网站用户细分，实现的功能与自定义访客群体（Custom Visitor Segments）差不多，可以算是后者的升级版。这两天正好用到这个功能，而网上关于它的应用案例又少得可怜，这里就介绍一下具体应用过程.
为什么要使用自定义变量（Custom Variables）实现？
GA的默认报告中是不提供A类商品页面的Pages/Visit的，在Custom Variables出现之前，我能想到的只有一个办法，通过高级群体或过滤器统计该群体的Visits，然后再手动查询A类商品页面的 PageViews，相除计算得出结果，比较麻烦...]]></description>
			<content:encoded><![CDATA[<p>自定义变量 （Custom Variables）是Google Analytics 2009年10月推出的一个功能，可以用来对网站用户细分，实现的功能与自定义访客群体（Custom Visitor Segments）差不多，可以算是后者的升级版。这两天正好用到这个功能，而网上关于它的应用案例又少得可怜，这里就介绍一下具体应用过程，如有不同意见，欢迎拍砖。</p>
<p>和Custom Visitor Segments需要使用_setVar()方法类似，Custom Variables也是通过_setCustomVar()方法来实现应用的，下面我们对这个方法做个简要说明：</p>
<p style="padding-left: 60px">_setCustomVar(index, name, value, opt_scope)</p>
<ul style="padding-left: 60px">
<li>index：变量序号，可选范围1～5</li>
<li>name：自定义变量名，GA自定义变量报告中看到最顶级报告类目就是变量名</li>
<li>value：为自定义变量赋值，和前面的自定义变量名搭配使用，点击自定义变量报告名后的下一级数据就是变量值，通常，一个自定义变量会有两个或更多的值，比如，一个自定义变量name是gender，那value就有male和female两个可能的值</li>
<li>opt_scope：自定义变量的范围，可选范围是1～3，1 （visitor级别） ，2（session级别），3（page级别）。如果留空，默认值是3。</li>
</ul>
<p>这里不再做更多说明，详情请参考<a href="http://code.google.com/intl/zh-CN/apis/analytics/docs/tracking/gaTrackingCustomVariables.html" target="_blank">GA官方说明</a>，下面我们看应用案例。</p>
<p><strong>应用一：某电子商务网站监测 A类商品页面（包括列表页和详情页）的人均访问页面数</strong></p>
<p>为什么要使用自定义变量（Custom Variables）实现？<br />
GA的默认报告中是不提供A类商品页面的Pages/Visit的，在Custom Variables出现之前，我能想到的只有一个办法，通过高级群体或过滤器统计该群体的Visits，然后再手动查询A类商品页面的PageViews，相除计算得出结果，比较麻烦。</p>
<p>具体实现方法<br />
1、部署代码</p>
<p>A类商品的所有列表页中部署代码     pageTracker._setCustomVar(1, “Page-Type”, “<span style="color: #339966">listpage</span>“, 3);<br />
A类商品的所有详情页中相关代码     pageTracker._setCustomVar(1, “Page-Type”, “<span style="color: #339966">detail</span>“, 3);</p>
<p>简要说明：</p>
<ul>
<li>自定义变量序号为1</li>
<li>自定义变量命名为Page-Type</li>
<li>列表页自定义变量赋值Page- Type=listpage，详情页变量赋值Page-Type=detail</li>
<li>该自定义变量应用层级是Page</li>
</ul>
<div>
<p>完整代码传统版：</p>
</div>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
document.write(unescape(&quot;%3Cscript src='&quot; + gaJsHost + &quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&quot;));
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
try {
var pageTracker = _gat._getTracker(&quot;UA-91xxxxxx-1&quot;);
pageTracker._setCustomVar(1, &quot;Page-Type&quot;, &quot;detail&quot;, 3);
pageTracker._trackPageview();
} catch(e){;};
&lt;/script&gt;
</pre>
<p>完整代码异步跟踪版：</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-91xxxxxx-1']);
_gaq.push(['_setCustomVar', 1, 'Page-Type', 'detail',3]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
&lt;/script&gt;</pre>
<p>2、报告结果<br />
报告查看位置   Visitors——Custom Variables</p>
<p style="text-align: center"><img class="alignnone size-medium  wp-image-89" src="http://www.adsem.org/wp-content/uploads/2010/05/pic1-300x61.jpg" alt="" width="300" height="61" /></p>
<p style="text-align: center">（图一、A类商品页面总数据）</p>
<p>其中Hits数就是A类商品页面总的点击次数，我们选择的自定义变量应用范围是page level，所以这里的数据实际上就是Pageviews，后面的Pages/Visit就是我们要的数据了。<br />
第一目标已达成，我们再点击进去，看一下A类商品列表页和详情页数据的具体数据.</p>
<p style="text-align: center"><a href="http://www.adsem.org/wp-content/uploads/2010/05/pic2.jpg"><img class="aligncenter" src="http://www.adsem.org/wp-content/uploads/2010/05/pic2-300x125.jpg" alt="" width="300" height="125" /></a>（图二、A类商品列表页和详情页数据）</p>
<p>3、列表页与详情页间的访问转化</p>
<p>可能细心的网友已经看到图一的Visits是40,091，而图二的Visits是52,111，这两者间的差值就是同时访问了列表页和详情页的Visits 数，这个数值可以用来衡量列表页和详情页间的引导是否顺畅友好。如果想进一步了解这类用户行为，可以使用高级群体细分，详细分析这部分用户的行为。</p>
<p><a href="http://www.adsem.org/wp-content/uploads/2010/05/pic31.jpg"><img class="aligncenter" src="http://www.adsem.org/wp-content/uploads/2010/05/pic31-300x165.jpg" alt="" width="300" height="165" /></a></p>
<p style="text-align: center">（图三、同时访问了列表页和详情页的用户-高级群体设置）</p>
<p><strong>应用二：</strong><strong>某电子商务网站</strong><strong>A类商品列表页的翻页情况统计</strong></p>
<p><strong> </strong>1、部署代码</p>
<p>假设A类商品有500件，列表页每页默认显示50件商品，在列表页中部署相应的代码<br />
第1页：pageTracker._setCustomVar(2, “Page-Flip”, “1&#8243;, 3);<br />
第2页：pageTracker._setCustomVar(2, “Page-Flip”, “2&#8243;, 3);<br />
………<br />
第50页： pageTracker._setCustomVar(2, “Page-Flip”, “50&#8243;, 3);</p>
<p>异步跟踪代码格式参考应用一</p>
<p>2、报告分析<br />
访问列表页的用户每次访问的平均翻页数是3.11</p>
<p style="text-align: center"><a href="http://www.adsem.org/wp-content/uploads/2010/05/pic4.jpg"><img class="aligncenter" src="http://www.adsem.org/wp-content/uploads/2010/05/pic4.jpg" alt="" width="461" height="131" /></a>（图四、A类商品列表页翻页数情况）</p>
<p>列表页具体翻页访问数分布</p>
<p style="text-align: center"><a href="http://www.adsem.org/wp-content/uploads/2010/05/pic5.jpg"><img class="aligncenter" src="http://www.adsem.org/wp-content/uploads/2010/05/pic5-300x148.jpg" alt="" width="300" height="148" /></a>（图五、列表页翻页访问量分布）</p>
<p>注意事项：</p>
<ul>
<li>自定义变量名和变量值的长度都不能超过64 bytes</li>
<li>变量名不能重复</li>
<li>_setCustomVar()需要放置在_trackPageview()前面</li>
<li>报告延时很严重，今天配置好，数据要两天后才能看到</li>
<li>自定义变量名和值尽量不要使用中文，否则显示的是编码后的形式，报告易读性会比较差。</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.adsem.org/163/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

