<?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>dudu&#039;s blog &#187; Eduardo Cereto</title>
	<atom:link href="http://eduardo.cereto.net/author/admin/feed" rel="self" type="application/rss+xml" />
	<link>http://eduardo.cereto.net</link>
	<description>Web Analytics, Javascript, Python and Rum</description>
	<lastBuildDate>Thu, 02 Feb 2012 01:26:26 +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>Serve static files locally with python</title>
		<link>http://eduardo.cereto.net/serve-static-files-locally-with-python</link>
		<comments>http://eduardo.cereto.net/serve-static-files-locally-with-python#comments</comments>
		<pubDate>Thu, 02 Feb 2012 01:25:53 +0000</pubDate>
		<dc:creator>Eduardo Cereto</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://eduardo.cereto.net/?p=183</guid>
		<description><![CDATA[This is just a self reference and of course can&#8217;t be used in production code. But if you&#8217;re willing to test something static real quick and want to avoid file:// protocol you can setup a convenient webserver with python. Just &#8230; <a href="http://eduardo.cereto.net/serve-static-files-locally-with-python">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is just a self reference and of course can&#8217;t be used in production code. But if you&#8217;re willing to test something static real quick and want to avoid file:// protocol you can setup a convenient webserver with python.</p>
<p>Just find the root you want to serve and use:</p>
<pre>python -m SimpleHTTPServer</pre>
<p>Now just point your browser to localhost:8000. </p>
<p>Bye bye local apache.</p>
]]></content:encoded>
			<wfw:commentRss>http://eduardo.cereto.net/serve-static-files-locally-with-python/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The bugfix that could make the internet 5% faster</title>
		<link>http://eduardo.cereto.net/the-bugfix-that-could-make-the-internet-faster</link>
		<comments>http://eduardo.cereto.net/the-bugfix-that-could-make-the-internet-faster#comments</comments>
		<pubDate>Thu, 12 Jan 2012 16:01:11 +0000</pubDate>
		<dc:creator>Eduardo Cereto</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[bugfix]]></category>
		<category><![CDATA[google analytics cookie]]></category>
		<category><![CDATA[google analytics impact]]></category>
		<category><![CDATA[speed]]></category>

		<guid isPermaLink="false">http://eduardo.cereto.net/?p=176</guid>
		<description><![CDATA[I&#8217;ve been working with Google Analytics for the last 3 years. When I started working with it it was already a very huge player on the market, but I&#8217;ve seen enormous growth on these  years. Google Analytics is the most used web analytics solution &#8230; <a href="http://eduardo.cereto.net/the-bugfix-that-could-make-the-internet-faster">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with Google Analytics for the last 3 years. When I started working with it it was already a very huge player on the market, but I&#8217;ve seen enormous growth on these  years. Google Analytics is the most used web analytics solution in the world. It&#8217;s used on currently 44.67% of the top million websites on the internet. ga.js is the most popular javascript snippet in the history of the internet.</p>
<p><strong>Google Analytics Usage on top websites:</strong></p>
<div id="attachment_177" class="wp-caption aligncenter" style="width: 610px"><a href="http://trends.builtwith.com/analytics/Google-Analytics"><img class="size-medium wp-image-177" title="GA Usage" src="http://eduardo.cereto.net/wp-content/uploads/2012/01/Screen-Shot-2012-01-12-at-1.17.55-PM-600x323.png" alt="" width="600" height="323" /></a><p class="wp-caption-text">source: builtwith.com</p></div>
<p>Imagine the responsibility of the Google engineering team that maintains the ga.js javascript file. While having to deal with multiple recent changes and new features on Google Analytics still have to make sure that their code runs as fast as possible and on all browsers that exist. They must support ie5.5 and low end mobile devices, otherwise these browsers wouldn&#8217;t show up on Google analytics reports. Still they must do it while keeping the code from affecting the website performance.</p>
<p>I must say that they do a great work on keeping that code. The asynchronous syntax while confusing at first is a very clever way to push code execution and loading way down on the queue, so browsers don&#8217;t delay the page loading to register a GA pageview. It&#8217;s clear that the GA team takes great care when it comes to how fast and seamless their code is.</p>
<p>The one point that still bothers me a lot regarding performance are the Google Analytics cookies. Let&#8217;s take a look at what GA cookies look like:</p>
<pre>&gt;document.cookie
"__utma=96182344.347392035.1326382423.1326382423.1326382423.1; __utmb=96182344.1.10.1326382423; __utmc=96182344; __utmz=96182344.1326382423.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)"
&gt;document.cookie.length
188</pre>
<p>This is a minimum GA cookie. It can get longer if you use Custom Variables and Google Website Optimizer. But let&#8217;s settle down with the minimum for now.<br />
These cookies are used iternally in GA to keep state and are manipulated by the code on ga.js javascript file. Different from most other cookies you might see out there these cookies don&#8217;t need to hit your webservers never. Still they hit your website every single time an HTTP request is made.</p>
<p>According to<a href="http://dev.chromium.org/spdy/spdy-whitepaper"> Google SPDY whitepaper</a> the average HTTP request is 700-800 bytes long. That means that GA Cookies represent about 25% of that HTTP request size. The moment you notice GA is present in about 50% of top websites you notice that useless GA cookies going around the internet represent 12% of all HTTP requests.</p>
<p>I&#8217;ve posted a bug regarding this issue on <a href="http://code.google.com/p/analytics-issues/issues/detail?can=5&amp;start=0&amp;num=100&amp;q=&amp;colspec=ID%20Component%20Type%20Status%20Priority%20Stars%20Summary&amp;groupby=&amp;sort=&amp;id=143">GA-Issues</a> a while ago. The idea is to use HTML5 localStorage to store the cookies on browsers that support it. Still it has attracted no attention so far. This bug fix could easily make the average HTTP request around 5% faster. We&#8217;re talking about the average speed of the whole internet.</p>
<p>The real picture is not that bad, since this only affect HTTP requests and not HTTP responses and that&#8217;s where the real data is. Still it&#8217;s funny to see something that huge going around unnoticed.</p>
]]></content:encoded>
			<wfw:commentRss>http://eduardo.cereto.net/the-bugfix-that-could-make-the-internet-faster/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Track social interactions as events for the google +1 button</title>
		<link>http://eduardo.cereto.net/track-social-interactions-as-events-for-the-google-1-button</link>
		<comments>http://eduardo.cereto.net/track-social-interactions-as-events-for-the-google-1-button#comments</comments>
		<pubDate>Wed, 13 Jul 2011 00:55:55 +0000</pubDate>
		<dc:creator>Eduardo Cereto</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[plusone]]></category>
		<category><![CDATA[_trackSocial]]></category>

		<guid isPermaLink="false">http://eduardo.cereto.net/?p=136</guid>
		<description><![CDATA[Google Analytics released recently the _trackSocial  for Google Analytics. It was part of a bigger release on several Social applications including Google+. Sometimes things have to be pushed out before they&#8217;re extensively tested, and a couple of bugs may come &#8230; <a href="http://eduardo.cereto.net/track-social-interactions-as-events-for-the-google-1-button">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Google Analytics released recently the <a href="http://analytics.blogspot.com/2011/07/social-plugin-tracking-in-google.html">_trackSocial  for Google Analytics</a>. It was part of a bigger release on several Social applications including Google+. Sometimes things have to be pushed out before they&#8217;re extensively tested, and a couple of bugs may come up.</p>
<p>With the social Tracking one specific bug bit me the other day. Google Analytics won&#8217;t apply hostname filter&#8217;s to the social interactions, and it may cause profiles that are filtered to only include traffic to domain A, showing social interactions for domain B. From there all sorts of bad things follow: 0 pageview visits, lower pages/visit and so on.</p>
<p>At first I thought about disabling the socialTracking on the +1 buttons, but it seems that the <a href="http://code.google.com/apis/+1button/#jsapi">API</a> don&#8217;t support it yet. But I found an undocumented feature to disable it. Now you can disable the socialtracking on the +1 button and use Events instead, since they go through the filters before showing up in your Google Analytics profile.</p>
<p><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/eduardocereto/rm6X8/embedded/html,js,result" width="320" height="240"></iframe></p>
<p>You&#8217;ll only want to use it if you are having problems with social tracking and hostnames filter. Otherwise the default behavior is way better since it will populate in separate Social reports.</p>
<h2>Update</h2>
<p>If you are using the asynchronous code for Google +1 button, loading the syntax is a little bit different.</p>
<p><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/eduardocereto/xVGWn/embedded/html,js,result" width="320" height="240"></iframe></p>
<p><em>Thanks Fábio Phms.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://eduardo.cereto.net/track-social-interactions-as-events-for-the-google-1-button/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cleaning up files with eval(base64 Malware</title>
		<link>http://eduardo.cereto.net/cleaning-up-files-with-evalbase64-malware</link>
		<comments>http://eduardo.cereto.net/cleaning-up-files-with-evalbase64-malware#comments</comments>
		<pubDate>Thu, 19 May 2011 22:56:22 +0000</pubDate>
		<dc:creator>Eduardo Cereto</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://eduardo.cereto.net/?p=122</guid>
		<description><![CDATA[This blog was recently infected with a eval(base64 malware. This kind of malware use site vulnerabilities to inject a long list of link in the beginning of pages so it theoretically improves those site&#8217;s SEO performance. This kind of strategy &#8230; <a href="http://eduardo.cereto.net/cleaning-up-files-with-evalbase64-malware">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This blog was recently infected with a eval(base64 malware. This kind of malware use site vulnerabilities to inject a long list of link in the beginning of pages so it theoretically improves those site&#8217;s SEO performance.</p>
<p>This kind of strategy is just sad, telling from the perspective of an SEO.</p>
<p>I came up with a nice oneliner to clear all that nasty code. Works great for me. May be useful for others.</p>
<pre name="code" class="sh">
find . -name "*.php" -print0 | \
xargs -0 -n 1 grep -l -Z eval.*base64 | \
xargs -0 -n 1 sed -i'.old' '/eval.*base64/ d'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://eduardo.cereto.net/cleaning-up-files-with-evalbase64-malware/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Otimização de Landing Pages no Search Labs</title>
		<link>http://eduardo.cereto.net/otimizacao-de-landing-pages-no-search-labs</link>
		<comments>http://eduardo.cereto.net/otimizacao-de-landing-pages-no-search-labs#comments</comments>
		<pubDate>Fri, 30 Jul 2010 15:01:47 +0000</pubDate>
		<dc:creator>Eduardo Cereto</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[#searchlabs]]></category>
		<category><![CDATA[landing page]]></category>
		<category><![CDATA[search labs 2010]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[teste a/b]]></category>
		<category><![CDATA[teste multivariavel]]></category>
		<category><![CDATA[website optimizer]]></category>

		<guid isPermaLink="false">http://eduardo.cereto.net/?p=109</guid>
		<description><![CDATA[Essa semana ocorreu o Search Labs 2010 em São Paulo. Eu participei junto com meu amigo Gerson Ribeiro com uma palestra sobre otimização de Landing Pages. A Palestra está hospedada no Slide Share. Otimização de Landing Pages View more presentations &#8230; <a href="http://eduardo.cereto.net/otimizacao-de-landing-pages-no-search-labs">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-medium wp-image-113" title="SearchLabs 2010" src="http://eduardo.cereto.net/wp-content/uploads/2010/07/4840617516_1ffe1c455d_b-600x450.jpg" alt="" width="600" height="450" /></p>
<p>Essa semana ocorreu o Search Labs 2010 em São Paulo. Eu participei junto com meu amigo Gerson Ribeiro com uma palestra sobre otimização de Landing Pages.<br />
A Palestra está hospedada no Slide Share.</p>
<div style="width:425px" id="__ss_4861062"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/gersonribeiro/otimizao-de-landing-pages" title="Otimização de Landing Pages">Otimização de Landing Pages</a></strong><object id="__sse4861062" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=otimizaodelandingpagessearchlabs-100728173717-phpapp02&#038;stripped_title=otimizao-de-landing-pages" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4861062" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=otimizaodelandingpagessearchlabs-100728173717-phpapp02&#038;stripped_title=otimizao-de-landing-pages" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/gersonribeiro">Gerson Ribeiro</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://eduardo.cereto.net/otimizacao-de-landing-pages-no-search-labs/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Analytics source override precedence</title>
		<link>http://eduardo.cereto.net/google-analytics-source-override-precedence</link>
		<comments>http://eduardo.cereto.net/google-analytics-source-override-precedence#comments</comments>
		<pubDate>Sat, 27 Feb 2010 20:05:05 +0000</pubDate>
		<dc:creator>Eduardo Cereto</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Campaign]]></category>
		<category><![CDATA[noo]]></category>
		<category><![CDATA[nooveride]]></category>
		<category><![CDATA[Origin]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://eduardo.cereto.net/?p=49</guid>
		<description><![CDATA[Google Analytics keeps track of 5 campaign variables all this information goes into _utmz cookie. This cookie has the following format: _utmz=1.1267299040.3.4.utmcsr=Source&#124;utmccn=Campaign&#124;utmcmd=Media&#124;utmcct=Content&#124;utmctr=Term There are basically 4 types of origins: Campaigns: this means the user clicked on an AdWords link or &#8230; <a href="http://eduardo.cereto.net/google-analytics-source-override-precedence">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>Google Analytics keeps track of 5 campaign variables all this information goes into _utmz cookie. This cookie has the following format:</div>
<div>
<blockquote>
<pre><code>_utmz=1.1267299040.3.4.utmcsr=<span style="color: #ff0000;"><strong>Source</strong></span>|utmccn=<span style="color: #ff0000;"><strong>Campaign</strong></span>|utmcmd=<span style="color: #ff0000;"><strong>Media</strong></span>|utmcct=<span style="color: #ff0000;"><strong>Content</strong></span>|utmctr=<span style="color: #ff0000;"><strong>Term</strong></span></code></pre>
</blockquote>
</div>
<div>There are basically 4 types of origins:</div>
<div>
<ul>
<li><strong>Campaigns</strong>: this means the user clicked on an AdWords link or a link with campaign variables.
<ul>
<li>You can customized all 5 Campaign Variables</li>
<li>If this is an AdWords visit the cookie is slightly different, it has the gclid number. GA will pull the correct value for the 5 variables from AdWords provided the accounts are linked.</li>
</ul>
</li>
</ul>
</div>
<div>
<ul>
<li><strong>Organic</strong>: When the user clicks on a link from a Search engine (e.g. google, bing, yahoo!, etc)
<ul>
<li>Source: google/bing/yahoo/etc</li>
<li>Campaign: (organic)</li>
<li>Media: organic</li>
<li>Term: Searched keyword</li>
</ul>
</li>
</ul>
</div>
<div>
<ul>
<li><strong>Referral</strong>: When a user clicks on a link from another site.
<ul>
<li>Source: www.referral-site.com</li>
<li>Campaign: (referral)</li>
<li>Media: referral</li>
<li>Content: /path/from/clicked/link</li>
</ul>
</li>
</ul>
</div>
<div>
<ul>
<li><strong>Direct</strong>: When Google can&#8217;t determine a better origin it uses this one. Usually it means the user typed the address directly in the address bar. But it could mean the user bookmarked the link or still clicked this link in msn, or another desktop application.
<ul>
<li>Source: (direct)</li>
<li>Campaign: (direct)</li>
<li>Media: (none)</li>
</ul>
</li>
</ul>
</div>
<div>What happens if you change your source during a visit? What if it happens in a different visit?</div>
<div>It all depends, here are the basic rules for this precedence.</div>
<h3>Returning Visitor</h3>
<ul>
<li>Direct never overrides</li>
<li>Campaign always overrides</li>
<li>Referral always overrides</li>
<li>Organic always overrides</li>
</ul>
<h3>Same Visit</h3>
<ul>
<li>Direct never overrides</li>
<li>Campaign always overrides</li>
<li>Referral never overrides</li>
<li>Organic always overrides</li>
</ul>
<h3>Extra</h3>
<p>I created a graphic to illustrate precedence.</p>
<p style="text-align: center;">
<p style="text-align: center;"><a href="http://eduardo.cereto.net/wp-content/uploads/2010/02/ga-origin.png"><img class="aligncenter size-full wp-image-65" title="ga-origin" src="http://eduardo.cereto.net/wp-content/uploads/2010/02/ga-origin.png" alt="" width="389" height="410" /></a></p>
<p style="text-align: center;">
<blockquote>
<p style="text-align: left;">People complained about the graphic being insanely hard to read. Here are the rules that make the graphic. Looks simpler but the graphic took me too much time to just remove it now. Besides it makes the post look good.</p>
<ul>
<li>Campaign, Organic and Referral source always override a previous source</li>
<li>Direct never overrides a previous source</li>
<li>If it&#8217;s inside the same session a referral source will never override previous source</li>
</ul>
</blockquote>
<p style="text-align: left;">You can also use the parameter utm_nooverride=1 in your URLs. If you use this parameter and already have a previous origin it  will never overrides the existing origin.</p>
]]></content:encoded>
			<wfw:commentRss>http://eduardo.cereto.net/google-analytics-source-override-precedence/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Google Analytics _setAllowHash bug</title>
		<link>http://eduardo.cereto.net/google-analytics-_setallowhash-bug</link>
		<comments>http://eduardo.cereto.net/google-analytics-_setallowhash-bug#comments</comments>
		<pubDate>Tue, 23 Feb 2010 17:40:29 +0000</pubDate>
		<dc:creator>Eduardo Cereto</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[ga.js]]></category>
		<category><![CDATA[GATC]]></category>
		<category><![CDATA[_setAllowHash]]></category>
		<category><![CDATA[_setNamespace]]></category>

		<guid isPermaLink="false">http://eduardo.cereto.net/?p=39</guid>
		<description><![CDATA[GATC (Google Analytics Tracking Code) has an annoying bug with _setAllowHash. Suppose you have something like this: Domain http://test.cereto.net/ that has a GATC for multiple sub-domains. Domain http://test2.cereto.net/ that has both our tracker and a secondary default tracker that we &#8230; <a href="http://eduardo.cereto.net/google-analytics-_setallowhash-bug">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>GATC (Google Analytics Tracking Code) has an annoying bug with _setAllowHash.</p>
<p>Suppose you have something like this:</p>
<ul>
<li>Domain http://test.cereto.net/ that has a GATC for multiple sub-domains.</li>
<li>Domain http://test2.cereto.net/ that has both our tracker and a secondary default tracker that we don&#8217;t control.</li>
</ul>
<p>If you use this configuration it should work as expected. Two sets of cookies are gonna be created. One set inside domain test2.cereto.net and the second set inside .cereto.net. GATC will know which cookie to look at on both cases.</p>
<p>But now suppose you also want to track domain www.my-other-domain.com in the same account. What you&#8217;d need to do is:</p>
<ul>
<li>Use _setAllowLinker(true) on both accounts.</li>
<li>Use _getLinkerUrl() or _link() on the links that go from one site to another and vice versa.</li>
<li>Use _setAllowHash(false) on both domains.</li>
</ul>
<p>_link() and _getLinkerUrl() will move the cookies from one domain to another. _setAllowLinker(true) is needed for GATC to look on URI for cookie parameters.</p>
<p>Q: Now why would you need _setAllowHash(false)? A: The GA cookies have a parameter that is a domain hash (in red below ). Of course the hashes from both our domains are gonna be diferent. In that case Google will trash the cookie when it sees that the hash doesn&#8217;t match the current domain. So we set _setAllowHash(false) and everything is  fine. Is it?</p>
<blockquote><p>Cookie with a domain hash<br />
__utma=<strong><span style="color: #ff0000;">253008534</span></strong>.504424944.1258547704.1258547704.1258547704.1</p>
<p>Cookie with Domain Hash disabled<br />
__utma=<span style="color: #ff0000;"><strong>1</strong></span>.504424944.1258547704.1258547704.1258547704.1</p></blockquote>
<p>But now we don&#8217;t have the Hash anymore and it&#8217;s very important to GATC. When we&#8217;re reading cookies with javascript we have no information about the cookie besides value and name. The Hash is important so GATC knows which is the right cookie for that specific GATC.</p>
<p>In our setup we&#8217;ll have two sets of cookies available from test2.directperformance.com.br. If we disable the Domain Hash on both there&#8217;s no way for GATC to get the correct one. This will lead to ga.js firing pageviews with mixed data from both the cookies. This will mix origin, user hash, custom variables and more. Generating unexpected results on Analytics Interface.</p>
<p>This is an old bug. You must avoid it but sometimes there&#8217;s no way. It&#8217;s present no matter if you use default _gat or the new <a href="http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html">Async Tracker</a> _gaq.</p>
<h3>Example</h3>
<p>I created a little test to illustrate the issue:</p>
<ul>
<li>Access <a href="http://test.cereto.net/?utm_source=CampX&amp;utm_medium=blog&amp;utm_campaign=promo">first domain using a url with campaign variables</a>. This has a single tracker/single cookie</li>
<li>Now access <a href="http://test2.cereto.net/">second domain directly</a>. It has two trackers each in a diferent domain, so 2 different cookies.</li>
<li>The cookies were created accordingly, one for each tracker. The first one still has the campaign origin, and the second should be a refferal from this blog now.</li>
<li>Since you have _setAllowHash(false) on both trackers, GATC don&#8217;t know which cookie to parse.</li>
<li>You can see using <a href="https://addons.mozilla.org/en-US/firefox/addon/6647">HttpFox</a> or similar that both pageviews have the same origin.</li>
</ul>
<p>As explained GATC didn&#8217;t know which was the correct cookie, and got the first one.</p>
<h3>Solution</h3>
<p>There&#8217;s no good solution at this time, besides avoiding this setup.</p>
<p>All could be solved if _setAllowLinker(true) simply ignored the domain hash and used the hash for the current domain instead, after all it makes no sense to check the domain hash on the cookies you&#8217;re importing.</p>
<p>There&#8217;s an undocumented feature on ga.js that seems to fix it. It&#8217;s the function _setNamespace(&#8216;ns&#8217;). If you use this on one or both trackers (with different Namespace for each of course). This problem is gone. But it&#8217;s not safe to use undocumented features as it might change in the future or removed completely generating unexpected results. You won&#8217;t want to use that on your production code.</p>
<p>This post is intended to get this bug properly documented since there&#8217;s no public bug tracker for ga.js and I didn&#8217;t get proper response or position from Google on any related user groups out there;</p>
]]></content:encoded>
			<wfw:commentRss>http://eduardo.cereto.net/google-analytics-_setallowhash-bug/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Event order in different browsers</title>
		<link>http://eduardo.cereto.net/event-order-in-different-browsers</link>
		<comments>http://eduardo.cereto.net/event-order-in-different-browsers#comments</comments>
		<pubDate>Thu, 30 Jul 2009 23:30:52 +0000</pubDate>
		<dc:creator>Eduardo Cereto</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[cross-browser]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://eduardo.cereto.net/?p=20</guid>
		<description><![CDATA[I had an issue today where my event had to be triggered after another event in the onload property of body. I wasn&#8217;t sure if my event would be triggered after or before so I wrote a quick code to &#8230; <a href="http://eduardo.cereto.net/event-order-in-different-browsers">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had an issue today where my event had to be triggered after another event in the onload property of body. I wasn&#8217;t sure if my event would be triggered after or before so I wrote a quick code to test it. I was pretty sure, from the very start, that the results would disappoint me.</p>
<p>Here&#8217;s the code I used to test.</p>
<pre class="javascript">&lt;html&gt;
&lt;head&gt;
 &lt;title&gt;Event Tests&lt;/title&gt;
 &lt;script&gt;
 if(window.addEventListener){
 window.addEventListener('load',function(){alert('event1')},false);
 }else if(window.attachEvent){
 window.attachEvent('onload',function(){alert('event1');})
 }
 &lt;/script&gt;
 &lt;script src='jquery-min.js'&gt;&lt;/script&gt;
 &lt;script&gt;
 $(document).ready(function(){
 alert('jq1');
 });

 if(window.addEventListener){
 window.addEventListener('load',function(){alert('event2')},false);
 }else if(window.attachEvent){
 window.attachEvent('onload',function(){alert('event2');})
 }

 $(document).ready(function(){
 alert('jq2');
 });
 &lt;/script&gt;
&lt;/head&gt;
&lt;body onload='alert("event3")'&gt;
 &lt;script&gt;
 if(window.addEventListener){
 window.addEventListener('load',function(){alert('event4')},false);
 }else if(window.attachEvent){
 window.attachEvent('onload',function(){alert('event4');})
 }
 $(document).ready(function(){
 alert('jq3');
 });
 if(window.addEventListener){
 window.addEventListener('load',function(){alert('event5')},false);
 }else if(window.attachEvent){
 window.attachEvent('onload',function(){alert('event5');})
 }
 &lt;/script&gt;
 &lt;h1&gt;Event Tests&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Firefox 3.5 &amp; Google Chrome</h3>
<p>Firefox and Chrome both worked as expected. The jQuery Events were triggered first as I suspected and I was starting to get happy. Here&#8217;s the order they executed.</p>
<ol>
<li>jq1</li>
<li>jq2</li>
<li>jq3</li>
<li>event1</li>
<li>event2</li>
<li>event3</li>
<li>event4</li>
<li>event5</li>
</ol>
<h3>Internet Explorer 8</h3>
<p>Here on the other hand things started to get ugly. My smile fade away while ie shouted the following:</p>
<ol>
<li>jq1</li>
<li>jq2</li>
<li>jq3</li>
<li>event3</li>
<li>event5</li>
<li>event4</li>
<li>event2</li>
<li>event1</li>
</ol>
<h3>Internet Explorer 6 &amp; 7</h3>
<p>Run while you can.</p>
<ol>
<li>jq1</li>
<li>jq2</li>
<li>jq3</li>
<li>event3</li>
<li>event2</li>
<li>event4</li>
<li>event5</li>
<li>event1</li>
</ol>
<p>I think these results are completely nonsense. I&#8217;d be glad if someone could shed some light on this behavior. At least jQuery can save you from this madness.</p>
<h3>Conclusion</h3>
<p>Do you want to control the way your events trigger cross-browser without insane hacks? Go with <strong>jQuery</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://eduardo.cereto.net/event-order-in-different-browsers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

