<?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>Reuben Yau &#187; Tracking</title>
	<atom:link href="http://www.reubenyau.com/category/tracking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reubenyau.com</link>
	<description>SEO Professional and Photographer</description>
	<lastBuildDate>Wed, 30 Nov 2011 03:55:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Live search referrer spamming</title>
		<link>http://www.reubenyau.com/live-search-referrer-spamming/</link>
		<comments>http://www.reubenyau.com/live-search-referrer-spamming/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 03:41:15 +0000</pubDate>
		<dc:creator>reuben</dc:creator>
				<category><![CDATA[MSN]]></category>
		<category><![CDATA[Tracking]]></category>
		<guid isPermaLink="false">http://www.reubenyau.com/live-search-referrer-spamming/</guid>
		<description><![CDATA[I don&#8217;t usually take much notice of Live search traffic to this blog because they usually don&#8217;t drive much if any traffic at all. But I decided to look today and noticed a few weird entries in Google Analytics. I had a bunch of referring keywords from live.com with 1 visit, 2 page views and [...]]]></description>
			<content:encoded><![CDATA[<div style="height:66px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.reubenyau.com%2Flive-search-referrer-spamming%2F&amp;layout=box_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=60"
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:60px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_google1" style="width:90px;">
					<g:plusone size="tall" href="http://www.reubenyau.com/live-search-referrer-spamming/" ></g:plusone>
				</div><div class="really_simple_share_digg" style="width:px;">
					<script type="text/javascript" src="http://widgets.digg.com/buttons.js"></script>
					<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http://www.reubenyau.com/live-search-referrer-spamming/&amp;title=Live search referrer spamming"></a>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical"
						data-text="Live search referrer spamming via @reubenyau" data-url="http://www.reubenyau.com/live-search-referrer-spamming/"
						data-via="" ></a>
				</div></div>
		<div style="clear:both;"></div><p>I don&#8217;t usually take much notice of Live search traffic to this blog because they usually don&#8217;t drive much if any traffic at all. But I decided to look today and noticed a few weird entries in Google Analytics. I had a bunch of referring keywords from live.com with 1 visit, 2 page views and 0 time on site. Click on the thumbnail to see the full size image:</p>
<p><a href='http://www.reubenyau.com/wp-content/uploads/2007/11/live-spam.gif' title='Live Search Referrer Spam'><img src='http://www.reubenyau.com/wp-content/uploads/2007/11/live-spam.thumbnail.gif' alt='Live Search Referrer Spam' /></a></p>
<p>When you see patterns like that, you have to assume that it&#8217;s a bot that&#8217;s hitting your site. I downloaded my logs for the past week and took a look. To my surprise there were entries like this:</p>
<p><code>65.55.165.26 - -<br />
[29/Sep/2007:12:12:45 -0400]<br />
"GET /black-people-on-ebay-again/ HTTP/1.0"<br />
200 25905 www.reubenyau.com<br />
"http://search.live.com/results.aspx?q=people&amp;mrt=en-us&amp;FORM=LIVSOP"<br />
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322)" "-"</code></p>
<p>If you&#8217;re not used to reading raw logs, the important items here are the IP address in the first line and the referrer in the 5th line.</p>
<p>Using <a href="http://whois.arin.net">whois.arin.net</a> you can see that the IP address belongs to Microsoft:</p>
<p><code>OrgName:    Microsoft Corp<br />
OrgID:      MSFT<br />
Address:    One Microsoft Way<br />
City:       Redmond<br />
StateProv:  WA<br />
PostalCode: 98052<br />
Country:    US</p>
<p>NetRange:   65.52.0.0 - 65.55.255.255<br />
CIDR:       65.52.0.0/14<br />
NetName:    MICROSOFT-1BLK<br />
NetHandle:  NET-65-52-0-0-1<br />
Parent:     NET-65-0-0-0-0<br />
NetType:    Direct Assignment<br />
NameServer: NS1.MSFT.NET<br />
NameServer: NS5.MSFT.NET<br />
NameServer: NS2.MSFT.NET<br />
NameServer: NS3.MSFT.NET<br />
NameServer: NS4.MSFT.NET<br />
Comment:<br />
RegDate:    2001-02-14<br />
Updated:    2004-12-09</p>
<p>RTechHandle: ZM23-ARIN<br />
RTechName:   Microsoft Corporation<br />
RTechPhone:  +1-425-882-8080<br />
RTechEmail:  noc@microsoft.com </p>
<p>OrgAbuseHandle: ABUSE231-ARIN<br />
OrgAbuseName:   Abuse<br />
OrgAbusePhone:  +1-425-882-8080<br />
OrgAbuseEmail:  abuse@microsoft.com</p>
<p>OrgAbuseHandle: HOTMA-ARIN<br />
OrgAbuseName:   Hotmail Abuse<br />
OrgAbusePhone:  +1-425-882-8080<br />
OrgAbuseEmail:  abuse@hotmail.com</p>
<p>OrgAbuseHandle: MSNAB-ARIN<br />
OrgAbuseName:   MSN ABUSE<br />
OrgAbusePhone:  +1-425-882-8080<br />
OrgAbuseEmail:  abuse@msn.com</p>
<p>OrgNOCHandle: ZM23-ARIN<br />
OrgNOCName:   Microsoft Corporation<br />
OrgNOCPhone:  +1-425-882-8080<br />
OrgNOCEmail:  noc@microsoft.com</p>
<p>OrgTechHandle: MSFTP-ARIN<br />
OrgTechName:   MSFT-POC<br />
OrgTechPhone:  +1-425-882-8080<br />
OrgTechEmail:  iprrms@microsoft.com</code></p>
<p>This type of behavior is certainly not in the spirit of the internet and something that&#8217;s definitely quite annoying.</p>
<p>So why is Microsoft referrer spamming me? I start searching on forums and I start finding that I&#8217;m not the only one being targeted here.</p>
<p><a href="http://ekstreme.com/thingsofsorts/blogging/yell-if-microsofts-livecom-spammed-you-too">http://ekstreme.com/thingsofsorts/blogging/yell-if-microsofts-livecom-spammed-you-too</a></p>
<p><a href="http://www.webmasterworld.com/msn_microsoft_search/3424476.htm">http://www.webmasterworld.com/msn_microsoft_search/3424476.htm</a></p>
<p><a href="http://www.seo-scoop.com/2007/11/13/past-time-for-msn-to-pony-up-to-the-real-truth-about-referrer-spam/">http://www.seo-scoop.com/2007/11/13/past-time-for-msn-to-pony-up-to-the-real-truth-about-referrer-spam/</a></p>
<p><a href="http://smackdown.blogsblogsblogs.com/2007/11/13/microsoft-needs-to-quit-fucking-with-my-adsense-scripts/">http://smackdown.blogsblogsblogs.com/2007/11/13/microsoft-needs-to-quit-fucking-with-my-adsense-scripts/</a></p>
<p>So as it turns out, msndude from webmasterworld apologizes and basically says &#8220;don&#8217;t worry, be happy &#8211; and btw, if you block it, you might get banned&#8221;. Here&#8217;s the actual quote:</p>
<blockquote><p>The traffic you are seeing is part of a quality check we run on selected pages. While we work on<br />
addressing your conerns, we would request that you do not actively block the IP addreses used by this quality check; blocking these IP addresses could prevent your site from being included in the Live Search index.</p></blockquote>
<p>HUH? Excuse me? You have a bot that&#8217;s not exactly being very nice but I&#8217;m not allowed to block it? What kind of practice is that? I don&#8217;t run a spammy MFA site. I don&#8217;t do anything shady, so why should I have to sit here and have my stats polluted for absolutely nothing in return. If Live was sending me traffic I could perhaps turn a blind eye, but considering that they&#8217;ve been on a pretty good downward trend recently, you&#8217;d think that they&#8217;d want to do a better job of appeasing webmasters. Here&#8217;s their traffic over the past few months according to quantcast:</p>
<p><a href="http://www.quantcast.com/live.com"><img src="http://ak.quantcast.com/live.com/graph.png?bgcolor=F5F7FF&#038;drionly=y&#038;height=160&#038;width=270&#038;did=1991302390&#038;summary=1" alt="live.com traffic by quantcast" /></a></p>
<p>As of tonight it&#8217;s being blocked. I really don&#8217;t want to play this game, but this type of behavior should not be tolerated by webmasters.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reubenyau.com/live-search-referrer-spamming/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Google Analytics 404 Tracking And Downloaded Files</title>
		<link>http://www.reubenyau.com/google-analytics-404-tracking-and-downloaded-files/</link>
		<comments>http://www.reubenyau.com/google-analytics-404-tracking-and-downloaded-files/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 04:12:59 +0000</pubDate>
		<dc:creator>reuben</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Tracking]]></category>
		<category><![CDATA[404 error tracking]]></category>
		<category><![CDATA[web analytics]]></category>
		<guid isPermaLink="false">http://www.reubenyau.com/google-analytics-404-tracking-and-downloaded-files/</guid>
		<description><![CDATA[I was reading Bruce Clay&#8217;s September Newsletter and came across a couple of inaccuracies in Jim Sterne&#8217;s web analytics article, specifically this part: Google won&#8217;t report on downloads of files like PDF&#8217;s, jpg&#8217;s of Flash. You want to know about server error messages? You have to look to the pay-to-play vendors. Well Google Analytics may [...]]]></description>
			<content:encoded><![CDATA[<div style="height:66px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.reubenyau.com%2Fgoogle-analytics-404-tracking-and-downloaded-files%2F&amp;layout=box_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=60"
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:60px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_google1" style="width:90px;">
					<g:plusone size="tall" href="http://www.reubenyau.com/google-analytics-404-tracking-and-downloaded-files/" ></g:plusone>
				</div><div class="really_simple_share_digg" style="width:px;">
					<script type="text/javascript" src="http://widgets.digg.com/buttons.js"></script>
					<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http://www.reubenyau.com/google-analytics-404-tracking-and-downloaded-files/&amp;title=Google Analytics 404 Tracking And Downloaded Files"></a>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical"
						data-text="Google Analytics 404 Tracking And Downloaded Files via @reubenyau" data-url="http://www.reubenyau.com/google-analytics-404-tracking-and-downloaded-files/"
						data-via="" ></a>
				</div></div>
		<div style="clear:both;"></div><p>I was reading Bruce Clay&#8217;s September Newsletter and came across a couple of inaccuracies in <a href="http://www.bruceclay.com/newsletter/volume39/web-analytics.html">Jim Sterne&#8217;s web analytics article</a>, specifically this part:</p>
<blockquote><p>Google won&#8217;t report on downloads of files like PDF&#8217;s, jpg&#8217;s of Flash. You want to know about server error messages? You have to look to the pay-to-play vendors.</p></blockquote>
<p>Well Google Analytics may not give you those reports out of the box, but it&#8217;s not too difficult to put these two solutions together:</p>
<p>1) Tracking files downloaded from your site:<br />
<a href="http://www.google.com/support/analytics/bin/answer.py?hl=en&#038;answer=27242">http://www.google.com/support/analytics/bin/answer.py?hl=en&#038;answer=27242</a></p>
<p>Caveat &#8211; this method only reports on people clicking links on your website which are tagged with this code. If someone remotely links to a file on your site, none of the javascript web analytics packages will report on that traffic.</p>
<p>2) Tracking 404 error pages:<br />
<a href="http://analytics.blogspot.com/2006/09/tip-tracking-404-pages.html">http://analytics.blogspot.com/2006/09/tip-tracking-404-pages.html</a></p>
<p>This could also be used to create error pages and tracking for 5XX errors.</p>
<p>And on a side note, for those of you who use WordPress, here&#8217;s a handy way to create a custom 404 page:<br />
<a href="http://codex.wordpress.org/Creating_an_Error_404_Page">http://codex.wordpress.org/Creating_an_Error_404_Page</a></p>
<p>If you have your Google Analytics code in a footer include file, you could create a second include and call it from the 404.php.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reubenyau.com/google-analytics-404-tracking-and-downloaded-files/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Website Optimizer Is Search Engine Friendly</title>
		<link>http://www.reubenyau.com/website-optimizer-is-search-engine-friendly/</link>
		<comments>http://www.reubenyau.com/website-optimizer-is-search-engine-friendly/#comments</comments>
		<pubDate>Wed, 20 Jun 2007 02:12:35 +0000</pubDate>
		<dc:creator>reuben</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Google AdWords]]></category>
		<category><![CDATA[PPC]]></category>
		<category><![CDATA[Tracking]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Work]]></category>
		<guid isPermaLink="false">http://www.reubenyau.com/website-optimizer-is-search-engine-friendly/</guid>
		<description><![CDATA[Website Optimizer by Google AdWords is a multivariate testing tool, that is to say, it takes A/B testing one step further. Instead of testing 2 versions of a page, you can test multiple page elements and the various combinations. When you create an experiment you can specify page elements that you want to test, for [...]]]></description>
			<content:encoded><![CDATA[<div style="height:66px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.reubenyau.com%2Fwebsite-optimizer-is-search-engine-friendly%2F&amp;layout=box_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=60"
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:60px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_google1" style="width:90px;">
					<g:plusone size="tall" href="http://www.reubenyau.com/website-optimizer-is-search-engine-friendly/" ></g:plusone>
				</div><div class="really_simple_share_digg" style="width:px;">
					<script type="text/javascript" src="http://widgets.digg.com/buttons.js"></script>
					<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http://www.reubenyau.com/website-optimizer-is-search-engine-friendly/&amp;title=Website Optimizer Is Search Engine Friendly"></a>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical"
						data-text="Website Optimizer Is Search Engine Friendly via @reubenyau" data-url="http://www.reubenyau.com/website-optimizer-is-search-engine-friendly/"
						data-via="" ></a>
				</div></div>
		<div style="clear:both;"></div><p><a href="http://services.google.com/websiteoptimizer/">Website Optimizer</a> by Google AdWords is a multivariate testing tool, that is to say, it takes A/B testing one step further. Instead of testing 2 versions of a page, you can test multiple page elements and the various combinations.</p>
<p>When you create an experiment you can specify page elements that you want to test, for example, a page heading, intro copy or a lead image. It uses javascript on the landing page to swap out the test element with the other variations that you specify within Website Optimizer.</p>
<p>I participated in the beta test of this and my initial concern was that it may not be search engine friendly due to the changing page elements, however, after a short call with the Website Optimizer Product Manager, he confirmed that it would not have any impact on organic rankings.</p>
<p>If you are still concerned about it, then you can always set up a specific landing page that is not linked to from your main navigation and use either the robots.txt or meta noindex tags to prevent search engines from crawling those pages.</p>
<p>Once your AdWords account is fairly well optimized, I would highly recommend trying out this tool. You will learn new things about your website, its traffic and motivators. Just make sure you carefully plan the test elements and don&#8217;t test too many elements at once to ensure that you can run through enough iterations with conversions to gain meaningful data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reubenyau.com/website-optimizer-is-search-engine-friendly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Analytics Developers, Please Update urchin.js</title>
		<link>http://www.reubenyau.com/google-analytics-developers-please-update-urchinjs/</link>
		<comments>http://www.reubenyau.com/google-analytics-developers-please-update-urchinjs/#comments</comments>
		<pubDate>Fri, 11 May 2007 22:04:43 +0000</pubDate>
		<dc:creator>reuben</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Tracking]]></category>
		<guid isPermaLink="false">http://www.reubenyau.com/google-analytics-developers-please-update-urchinjs/</guid>
		<description><![CDATA[I was looking through an overall keyword conversion report in Analytics and noticed some strange search phrases appearing. They looked like long strings of random numbers and characters. It turns out that AOL must be testing some new URL structure in the search results and changed the variable that identifies the search query. I took [...]]]></description>
			<content:encoded><![CDATA[<div style="height:66px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.reubenyau.com%2Fgoogle-analytics-developers-please-update-urchinjs%2F&amp;layout=box_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=60"
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:60px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_google1" style="width:90px;">
					<g:plusone size="tall" href="http://www.reubenyau.com/google-analytics-developers-please-update-urchinjs/" ></g:plusone>
				</div><div class="really_simple_share_digg" style="width:px;">
					<script type="text/javascript" src="http://widgets.digg.com/buttons.js"></script>
					<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http://www.reubenyau.com/google-analytics-developers-please-update-urchinjs/&amp;title=Google Analytics Developers, Please Update urchin.js"></a>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical"
						data-text="Google Analytics Developers, Please Update urchin.js via @reubenyau" data-url="http://www.reubenyau.com/google-analytics-developers-please-update-urchinjs/"
						data-via="" ></a>
				</div></div>
		<div style="clear:both;"></div><p>I was looking through an overall keyword conversion report in Analytics and noticed some strange search phrases appearing. They looked like long strings of random numbers and characters. It turns out that AOL must be testing some new URL structure in the search results and changed the variable that identifies the search query. I took a look at the urchin.js and noticed that the new query variable (userQuery) is not included.</p>
<p>The urchin.js file currently has these variables to define AOL:</p>
<p><code>_uOsr[3]="aol";		_uOkw[3]="query";<br />
_uOsr[4]="aol";		_uOkw[4]="encquery";</code></p>
<p>To track the new AOL search queries just place these 2 lines before the urchinTracker() function in your Google Analytics tracking code:</p>
<p><code>_uOsr.push("aol");<br />
_uOkw.push("userQuery");</code></p>
<p>Update: I replaced the manual insertion of elements into the _uOsr and _uOkw arrays with the push() function which is a much better solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reubenyau.com/google-analytics-developers-please-update-urchinjs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Analytics Tracking Code &#8211; HTTPS and Full External Referrer Only</title>
		<link>http://www.reubenyau.com/google-analytics-tracking-code-https-and-full-external-referrer-only/</link>
		<comments>http://www.reubenyau.com/google-analytics-tracking-code-https-and-full-external-referrer-only/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 03:21:06 +0000</pubDate>
		<dc:creator>reuben</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Tracking]]></category>
		<category><![CDATA[Work]]></category>
		<guid isPermaLink="false">http://www.reubenyau.com/google-analytics-tracking-code-https-and-full-external-referrer-only/</guid>
		<description><![CDATA[Part 1 &#8211; Detecting http and https Mode Using Javascript A while back I came across a scenario where a website (typically an ecommerce site) can serve part of their website in both http and https mode. These sites typically use the same template or footer include file for both browser modes. This causes a [...]]]></description>
			<content:encoded><![CDATA[<div style="height:66px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.reubenyau.com%2Fgoogle-analytics-tracking-code-https-and-full-external-referrer-only%2F&amp;layout=box_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=60"
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:60px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_google1" style="width:90px;">
					<g:plusone size="tall" href="http://www.reubenyau.com/google-analytics-tracking-code-https-and-full-external-referrer-only/" ></g:plusone>
				</div><div class="really_simple_share_digg" style="width:px;">
					<script type="text/javascript" src="http://widgets.digg.com/buttons.js"></script>
					<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http://www.reubenyau.com/google-analytics-tracking-code-https-and-full-external-referrer-only/&amp;title=Google Analytics Tracking Code &amp;#8211; HTTPS and Full External Referrer Only"></a>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical"
						data-text="Google Analytics Tracking Code &#8211; HTTPS and Full External Referrer Only via @reubenyau" data-url="http://www.reubenyau.com/google-analytics-tracking-code-https-and-full-external-referrer-only/"
						data-via="" ></a>
				</div></div>
		<div style="clear:both;"></div><p><strong>Part 1 &#8211; Detecting http and https Mode Using Javascript</strong><br />
A while back I came across a scenario where a website (typically an ecommerce site) can serve part of their website in both http and https mode. These sites typically use the same template or footer include file for both browser modes. This causes a security alert popup in the browser because the remote javascript file is called using a http request. While this isn&#8217;t a security threat, it could cause some less technically savvy users to be concerned about the site security and perhaps not want to complete the transaction.</p>
<p>Google does offer the webmaster the ability to <a href="http://www.google.com/support/analytics/bin/answer.py?answer=31846">request the urchin.js file using a https</a> call, which works well, except what we really need, is a way to detect which mode we&#8217;re in, then make the appropriate request on the javascript file.</p>
<p>With help from some members on SEORefugee we <a href="http://www.seorefugee.com/forums/showthread.php?t=4238">figured out</a> how it can be done.</p>
<p><strong>Part 2 &#8211; Only Obtaining External Referrers</strong><br />
Sunday night I was looking through my Top Content report and realized that after my <a href="http://www.reubenyau.com/google-analytics-hack-obtaining-full-referring-url/">hack to obtain the full referrer</a>, it&#8217;s fairly indiscriminate and will obtain all referrers, both internal and external. While I already knew about this, I guess that night I was tired and grumpy and it just bugged me enough to want to fix it.</p>
<p>The whole point of my hack was to obtain the external referrer, so I came up with some more javascript to detect whether the referrer is internal or external and write out the urchinTracker function accordingly, so it will only record the external referrers.</p>
<p><strong>The Grand Finale</strong><br />
So putting all this together we get this:</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
	document.write( '&lt;scr'+'ipt type="text/javascript" src="' );<br />
	if( document.location.toString().indexOf( 'https://' ) != -1 ) {<br />
		document.write( 'https://ssl' );<br />
	} else {<br />
		document.write( 'http://www' );<br />
	}<br />
	document.write( '.google-analytics.com/urchin.js"&gt;&lt;\/scr'+'ipt&gt;' );<br />
&lt;/script&gt;</p>
<p>&lt;script type="text/javascript"&gt;<br />
_uacct = "UA-XXXXXX-X";<br />
urchinTracker();<br />
&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;<br />
document.write( '&lt;scr'+'ipt type="text/javascript"&gt;' );<br />
	if( document.referrer.toString().indexOf( 'www.mywebsite.com' ) ==-1 ) {<br />
		document.write( 'urchinTracker(document.referrer);' );<br />
	}<br />
document.write( '&lt;\/scr'+'ipt&gt;' );<br />
&lt;/script&gt;</code></p>
<p>Just replace the XXX&#8217;s with your Analytics account number and &#8220;www.mywebsite.com&#8221; with your website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reubenyau.com/google-analytics-tracking-code-https-and-full-external-referrer-only/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Testing Google Analytics Regular Expressions In Real Time</title>
		<link>http://www.reubenyau.com/testing-google-analytics-regular-expressions-in-real-time/</link>
		<comments>http://www.reubenyau.com/testing-google-analytics-regular-expressions-in-real-time/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 15:53:35 +0000</pubDate>
		<dc:creator>reuben</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Tracking]]></category>
		<guid isPermaLink="false">http://www.reubenyau.com/testing-google-analytics-regular-expressions-in-real-time/</guid>
		<description><![CDATA[If you have a dynamic website and want to set up conversion goals within Google Analytics, you may need to use regular expressions to define the goal page. These are extremely useful because they can be used to match specific sequences of characters in a URL. They&#8217;re a huge expansion on the common wildcard characters [...]]]></description>
			<content:encoded><![CDATA[<div style="height:66px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.reubenyau.com%2Ftesting-google-analytics-regular-expressions-in-real-time%2F&amp;layout=box_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=60"
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:60px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_google1" style="width:90px;">
					<g:plusone size="tall" href="http://www.reubenyau.com/testing-google-analytics-regular-expressions-in-real-time/" ></g:plusone>
				</div><div class="really_simple_share_digg" style="width:px;">
					<script type="text/javascript" src="http://widgets.digg.com/buttons.js"></script>
					<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http://www.reubenyau.com/testing-google-analytics-regular-expressions-in-real-time/&amp;title=Testing Google Analytics Regular Expressions In Real Time"></a>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical"
						data-text="Testing Google Analytics Regular Expressions In Real Time via @reubenyau" data-url="http://www.reubenyau.com/testing-google-analytics-regular-expressions-in-real-time/"
						data-via="" ></a>
				</div></div>
		<div style="clear:both;"></div><p>If you have a dynamic website and want to set up conversion goals within Google Analytics, you may need to use <a href="http://www.google.com/support/analytics/bin/answer.py?answer=27217">regular expressions</a> to define the goal page.</p>
<p>These are extremely useful because they can be used to match specific sequences of characters in a URL. They&#8217;re a huge expansion on the common wildcard characters * and ? and tend to work out very well for ecommerce websites.</p>
<p>Here&#8217;s a typical example of how you can use them to great effect. Usually when you set up a conversion goal you have to specify a goal URL, that is, a page the user gets to which triggers that a conversion has taken place. In the case of an ecommerce website, it would be the receipt page, or &#8220;thank you&#8221; page once the user has purchased something. But in many cases the URL of that page is dynamic and may contain OrderID or CustomerID variables. Since this page changes every time, we need to use a regular expression so we can match the URL regardless of the value of those variables.</p>
<p>If you&#8217;re new to Google Analytics, you probably started off setting up a goal with your first attempt at a regular expression, going to your website to complete a test transaction, waiting approximately 3 hours then checking your stats. Not exactly the most efficient way of going about things, especially if you&#8217;re new to regular expressions.</p>
<p>If that&#8217;s the way you normally do it, here&#8217;s a massive time saving tip. You can test your regular expression live on previous data and it will take you just a matter of minutes to complete the goal.</p>
<p>1) Once logged in to Analytics, go to Content Optimization > Content Performance > Top Content<br />
2) In the filter at the top of the screen enter your regular expression and hit enter.<br />
3) Look at the content results and keep fine tuning your regular expression until you see the desired match appear</p>
<p>Here&#8217;s a real example used on an ecommerce site. The regular expression I used to filter the data was:<br />
<code>^/orderthankyou\.asp.*</code></p>
<p>Click on the image to see a screenshot of the results:<br />
<a href='http://www.reubenyau.com/wp-content/uploads/2007/03/analytics-regex-example.gif' title='Google Analytics Regular Expression Example'><img src='http://www.reubenyau.com/wp-content/uploads/2007/03/analytics-regex-example.thumbnail.gif' alt='Google Analytics Regular Expression Example' /></a></p>
<p>Just be sure to scroll through all results, to make sure it didn&#8217;t pick up anything else, otherwise your conversion stats will be overinflated.</p>
<p><strong>More Help</strong><br />
<a href="http://www.google.com/support/analytics/bin/answer.py?answer=27217">Google Analytics Regular Expressions Syntax</a><br />
<a href="http://www.google.com/analytics/conversionuniversity.html">Conversion University</a><br />
<a href="http://www.google.com/support/analytics">Google Analytics Support Pages</a><br />
<a href="http://groups.google.com/group/analytics-help">Google Analytics Google Group</a></p>
<p>Edit: Corrected syntax, thanks Mark.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reubenyau.com/testing-google-analytics-regular-expressions-in-real-time/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Google Analytics Full Referrer Tracking Update</title>
		<link>http://www.reubenyau.com/google-analytics-full-referrer-tracking-update/</link>
		<comments>http://www.reubenyau.com/google-analytics-full-referrer-tracking-update/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 18:03:00 +0000</pubDate>
		<dc:creator>reuben</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Tracking]]></category>
		<guid isPermaLink="false">http://www.reubenyau.com/google-analytics-full-referrer-tracking-update/</guid>
		<description><![CDATA[Since I wrote about tracking the full referrer in Google Analytics, I had feedback from some people saying that their content management system, forum software, etc doesn&#8217;t allow them to modify the HEAD section or BODY tag. Some other people are also hesitant to place the code in the HEAD section incase the Google Analytics [...]]]></description>
			<content:encoded><![CDATA[<div style="height:66px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:100px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.reubenyau.com%2Fgoogle-analytics-full-referrer-tracking-update%2F&amp;layout=box_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=60"
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:60px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_google1" style="width:90px;">
					<g:plusone size="tall" href="http://www.reubenyau.com/google-analytics-full-referrer-tracking-update/" ></g:plusone>
				</div><div class="really_simple_share_digg" style="width:px;">
					<script type="text/javascript" src="http://widgets.digg.com/buttons.js"></script>
					<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http://www.reubenyau.com/google-analytics-full-referrer-tracking-update/&amp;title=Google Analytics Full Referrer Tracking Update"></a>
				</div><div class="really_simple_share_twitter" style="width:110px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical"
						data-text="Google Analytics Full Referrer Tracking Update via @reubenyau" data-url="http://www.reubenyau.com/google-analytics-full-referrer-tracking-update/"
						data-via="" ></a>
				</div></div>
		<div style="clear:both;"></div><p>Since I wrote about <a href="http://www.reubenyau.com/google-analytics-hack-obtaining-full-referring-url/">tracking the full referrer in Google Analytics</a>, I had feedback from some people saying that their content management system, forum software, etc doesn&#8217;t allow them to modify the HEAD section or BODY tag. Some other people are also hesitant to place the code in the HEAD section incase the Google Analytics servers are slow, causing the page to pause while the tracking code is downloaded from Google. Another drawback to putting the tracking code high up on the page is that you may end up counting partial page downloads.</p>
<p>So to get around these issues here&#8217;s an alternative which you can place just before the end BODY tag.</p>
<p><code>&lt;script src="http://www.google-analytics.com/urchin.js" type="text/javascript"&gt;<br />
&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;<br />
_uacct = "UA-XXXXXX-X";<br />
urchinTracker();<br />
urchinTracker(document.referrer);<br />
&lt;/script&gt;</code></p>
<p>Just replace the XXX&#8217;s with your Analytics account code.</p>
<p>Update: I&#8217;ve augmented the tracking code to also detect if the page is served in http or https mode to serve the appropriate call to the urchin.js file, and also detecting whether the referrer is internal or external so you don&#8217;t get your site appearing as a full referrer in the Top Content Report. View my <a href="http://www.reubenyau.com/google-analytics-tracking-code-https-and-full-external-referrer-only/">Ultimate Google Analytics Tracking Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reubenyau.com/google-analytics-full-referrer-tracking-update/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

