<?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>Really Aced &#187; setVar</title>
	<atom:link href="http://blog.sommestad.net/tag/setvar/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sommestad.net</link>
	<description>Client-side development through the eyes of Kristofer Sommestad, a Jadestone developer and client architect.</description>
	<lastBuildDate>Fri, 03 Sep 2010 13:35:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google Analytics setVar() deprecated and replaced by setCustomVar()</title>
		<link>http://blog.sommestad.net/2009/12/google-analytics-setvar-deprecated-and-replaced-by-setcustomvar/</link>
		<comments>http://blog.sommestad.net/2009/12/google-analytics-setvar-deprecated-and-replaced-by-setcustomvar/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 13:49:44 +0000</pubDate>
		<dc:creator>esset</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[old news]]></category>
		<category><![CDATA[setCustomVar]]></category>
		<category><![CDATA[setVar]]></category>

		<guid isPermaLink="false">http://blog.sommestad.net/?p=249</guid>
		<description><![CDATA[
			
				
			
		
For a while, there&#8217;s been a possibility to separate your users in various segments in Google Analytics, by setting a (single) variable in the Analytics cookie, for example:
pageTracker._setVar("member-premium-true");
Earlier this year, Google introduced the neat possibility to use multiple custom variables, allowing more customization and flexibility. You are allowed to use five slots (1-5) and set [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 1em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sommestad.net%2F2009%2F12%2Fgoogle-analytics-setvar-deprecated-and-replaced-by-setcustomvar%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sommestad.net%2F2009%2F12%2Fgoogle-analytics-setvar-deprecated-and-replaced-by-setcustomvar%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>For a while, there&#8217;s been a possibility to separate your users in various segments in Google Analytics, by setting a (single) variable in the Analytics cookie, for example:</p>
<pre class="prettyprint"><span class="pln">pageTracker</span><span class="pun">.</span><span class="pln">_setVar</span><span class="pun">(</span><span class="str">"member-premium-true"</span><span class="pun">)</span>;</pre>
<p>Earlier this year, Google introduced the neat possibility to <a href="http://code.google.com/intl/sv/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#examples">use multiple custom variables</a>, <a href="http://www.analyticsmarket.com/blog/multiple-custom-variables">allowing more customization and flexibility</a>. You are allowed to use five slots (1-5) and set a name, value and scope to your variable.<br />
The old <a href="http://code.google.com/intl/sv/apis/analytics/docs/gaJS/gaJSApiBasicConfiguration.html#_gat.GA_Tracker_._setVar">setVar</a> method has been deprecated and replaced by the new <a href="http://code.google.com/intl/sv/apis/analytics/docs/gaJS/gaJSApiBasicConfiguration.html#_gat.GA_Tracker_._setCustomVar">setCustomVar</a>:</p>
<pre class="prettyprint"><span class="pln">pageTracker</span><span class="pun">.</span><span class="pln">_setCustomVar</span><span class="pun">(</span><span class="pln">
      </span><span class="lit">1</span><span class="pun">,</span><span class="pln">                </span><span class="com">// This custom var is set to slot #1</span><span class="pln">
      </span><span class="str">"Member Type"</span><span class="pun">,</span><span class="pln">    </span><span class="com">// The name of the custom variable</span><span class="pln">
      </span><span class="str">"Premium"</span><span class="pun">,</span><span class="pln">        </span><span class="com">// The value of the custom variable</span><span class="pln">
      </span><span class="lit">1</span><span class="pln">                 </span><span class="com">// Sets the scope to visitor-level</span><span class="pln">
 </span><span class="pun">);</span><span class="pln">
pageTracker</span><span class="pun">.</span><span class="pln">_trackPageview</span><span class="pun">();</span><span class="pln">
</span></pre>
<p><em>This isn&#8217;t really news, but it wasn&#8217;t obvious what had happened by just looking at the <a href="http://code.google.com/intl/sv/apis/analytics/docs/gaJS/gaJSApi.html">Google Analytics API docs</a>, so I thought I&#8217;d mention it here just to &#8220;spread the word&#8221;.<br />
</em></p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">
<pre id="line3644">&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>&gt;
				pageTracker._setVar('member-premium-true');
			&lt;/<span class="end-tag">script</span>&gt;</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.sommestad.net/2009/12/google-analytics-setvar-deprecated-and-replaced-by-setcustomvar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Danger in using Google Analytics for Flash?</title>
		<link>http://blog.sommestad.net/2009/09/danger-in-using-google-analytics-for-flash/</link>
		<comments>http://blog.sommestad.net/2009/09/danger-in-using-google-analytics-for-flash/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 15:10:52 +0000</pubDate>
		<dc:creator>esset</dc:creator>
				<category><![CDATA[Flash & Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[bounce rate]]></category>
		<category><![CDATA[ga for flash]]></category>
		<category><![CDATA[ga.js]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[screen resolution]]></category>
		<category><![CDATA[setVar]]></category>
		<category><![CDATA[time on site]]></category>

		<guid isPermaLink="false">http://blog.sommestad.net/?p=144</guid>
		<description><![CDATA[
			
				
			
		
I recently discovered that some of our stats in Google Analytics looked a bit suspicious. When looking into it, I remembered that there was a previous issue in the ga.js tracker, causing usage of user-defined variables, setVar(), to be tracked as pageviews. These pageviews corrupted stats like bounce rates and time on site.
Google fixed this [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 1em;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sommestad.net%2F2009%2F09%2Fdanger-in-using-google-analytics-for-flash%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sommestad.net%2F2009%2F09%2Fdanger-in-using-google-analytics-for-flash%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I recently discovered that some of our stats in Google Analytics looked a bit suspicious. When looking into it, I remembered that there was a previous issue in the ga.js tracker, causing usage of user-defined variables, setVar(), to be tracked as pageviews. These pageviews corrupted stats like bounce rates and time on site.</p>
<p><a href="http://analytics.blogspot.com/2009/01/using-setvar-heres-update-on-bounce.html">Google fixed this issue</a> in January, but the latest <a href="http://code.google.com/p/gaforflash/">GA for Flash</a> release is from December. So there&#8217;s a big chance that the bug still remains in the ActionScript version. I&#8217;ve <a href="http://groups.google.com/group/ga-for-flash/browse_thread/thread/5061b36eaf8e58ff">posted a question</a> in the <a href="http://groups.google.com/group/ga-for-flash">GA for Flash discussion group</a>, but as the group seems to be full of porn spam, I&#8217;m not very hopeful in getting an answer right now&#8230;</p>
<p>Also, some of our stats were missing data about screen resolution etc and I fear that the Flash tracker and setVar() is the root of that as well (since it&#8217;s working fine in products where setVar() isn&#8217;t used).</p>
<p>Anywho. I&#8217;ve not yet confirmed that this bug is still there, but an easy solution is to use Google Analytics for Flash in &#8220;<a href="http://code.google.com/intl/sv/apis/analytics/docs/tracking/flashTrackingIntro.html">Bridge mode</a>&#8220;, instead of &#8220;AS3 mode&#8221;. This means that the ga.js file is used, which is a guarantee that the latest official Google updates are always used.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sommestad.net/2009/09/danger-in-using-google-analytics-for-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
