<?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>Barry Hand &#187; ga.js</title>
	<atom:link href="http://www.barryhand.ie/blog/tag/ga-js/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barryhand.ie</link>
	<description>Addicted to Trying</description>
	<lastBuildDate>Mon, 06 Sep 2010 07:11:53 +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>Speeding up your website when using Google Analytics</title>
		<link>http://www.barryhand.ie/blog/speeding-up-your-website-when-using-google-analytics/</link>
		<comments>http://www.barryhand.ie/blog/speeding-up-your-website-when-using-google-analytics/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 07:07:12 +0000</pubDate>
		<dc:creator>Barry</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[ga.js]]></category>
		<category><![CDATA[urchin]]></category>

		<guid isPermaLink="false">http://www.barryhand.ie/?p=186</guid>
		<description><![CDATA[With Google Analytic improving and embracing on page download/action tracking, it is increasingly popular to insert the Google Analytic code before the page loads, inside the tag and call it OnLoad. With that comes the problem of executing a piece of script which will make your page load slowly if there&#8217;s a delay in loading [...]]]></description>
			<content:encoded><![CDATA[<p>With Google Analytic improving and embracing <a href="http://www.advanced-web-metrics.com/blog/2008/06/08/updated-tracking-script-for-gajs/"  target="blank">on page download/action tracking</a>, it is increasingly popular to insert the Google Analytic code before the page loads, inside the  tag and call it OnLoad.</p>
<p>With that comes the problem of executing a piece of script which will make your page load slowly if there&#8217;s a delay in loading the external ga.js file.</p>
<h3>0.3 seconds average load time</h3>
<p>Regardless if you place the code in the  or just before the tag, some interesting information is available from <a href="http://royal.pingdom.com/2009/01/30/google-analytics-script-loads-97-slower-at-peak-hours-%E2%80%93-in-europe/"  target="blank">Pingdom</a> on the average load times of the external Google Analytics code.</p>
<h3>Loads 97% slower at peak hours – in Europe</h3>
<p><a href="http://www.barryhand.ie/wp-content/uploads/2009/02/google-analytics-loading-time.png"><br />
</a><img class="alignnone size-full wp-image-187" title="google-analytics-loading-time" src="http://www.barryhand.ie/wp-content/uploads/2009/02/google-analytics-loading-time.png" alt="google-analytics-loading-time" width="559" height="289" /></p>
<p>On average the load time across Europe is 0.3 seconds, which may not seem large, but with the popularity increasing and the relevantly poor internet connections in Ireland &#8211; this can be an issue.</p>
<h3>Installing it locally</h3>
<p>Hosting the JavaScript file locally is easy, with <a href="http://www.google.com/support/analytics/bin/answer.py?hl=en&amp;answer=55466"  target="blank">advise by Google</a> themselves.</p>
<p>First, you&#8217;ll need to download this file <a target="_blank" href="http://www.google-analytics.com/ga.js" >http://www.google-analytics.com/ga.js</a> and upload it to your web server. (note: this is the newer Google Analytics code)</p>
<p>Now replace the following piece of code on your web page or blog</p>
<blockquote><p><code>document.write(unescape("%3Cscript src='" + gaJsHost + <strong>"google-analytics.com/ga.js</strong>' type='text/javascript'%3E%3C/script%3E"));</code></p></blockquote>
<p>and replace it with</p>
<blockquote><p><code>document.write(unescape("%3Cscript src='" + gaJsHost + <strong>"your-website.com/ga.js</strong>' type='text/javascript'%3E%3C/script%3E"));</code></p></blockquote>
<p>Once complete, you can verify that the code is tracking by checking the <a target="_blank" href="https://www.google.com/analytics/settings/check_status_profile_handler?" >tracking status in Google Analytics</a>.</p>
<h3>More reading</h3>
<ul>
<li><a href="http://code.google.com/apis/analytics/docs/"  target="blank">Google Analytics docs (info on all things ga.js)</a></li>
<li>Top methods for speeding up website by <a href="http://www.askapache.com/web-cache/top-methods-for-faster-speedier-web-sites.html"  target="blank">AskApache.com</a></li>
<li>Google Analytics <a target="_blank" href="http://www.grokdotcom.com/2008/10/16/google_analytics_hacks/ target=" _blank">Plugins &amp; Hacks</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.barryhand.ie/blog/speeding-up-your-website-when-using-google-analytics/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
