<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Making google analytics unobtrusive</title>
	<atom:link href="http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/</link>
	<description>I work and play at TUI Ski where I spend my days endeavoring to craft delightful interactive experiences. At home I like country pubs, listening to the eclectic delights of French radio FIP and am daddy to a clutch of cheeky little monsters. Any opinions expressed here are mine and do not represent the opinions of any company I work for.</description>
	<lastBuildDate>Fri, 20 Aug 2010 04:02:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: links for 2010-08-19 &#171; Sspyrison&#8217;s Blog</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-271</link>
		<dc:creator>links for 2010-08-19 &#171; Sspyrison&#8217;s Blog</dc:creator>
		<pubDate>Fri, 20 Aug 2010 04:02:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-271</guid>
		<description>[...] » Making google analytics unobtrusive Al Stevens – Art director, interactive and user experience ... (tags: private googleanalytics) [...]</description>
		<content:encoded><![CDATA[<p>[...] » Making google analytics unobtrusive Al Stevens – Art director, interactive and user experience &#8230; (tags: private googleanalytics) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Levi</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-268</link>
		<dc:creator>Levi</dc:creator>
		<pubDate>Wed, 21 Jul 2010 20:21:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-268</guid>
		<description>Al, yes that helps, thanks for your response.</description>
		<content:encoded><![CDATA[<p>Al, yes that helps, thanks for your response.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al Stevens</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-267</link>
		<dc:creator>Al Stevens</dc:creator>
		<pubDate>Sun, 18 Jul 2010 19:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-267</guid>
		<description>@bobdobbs I&#039;m hoping to upgrade this tutorial soon! I hope you managed to solve it though.</description>
		<content:encoded><![CDATA[<p>@bobdobbs I&#8217;m hoping to upgrade this tutorial soon! I hope you managed to solve it though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al Stevens</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-266</link>
		<dc:creator>Al Stevens</dc:creator>
		<pubDate>Sun, 18 Jul 2010 19:55:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-266</guid>
		<description>@Levi - thanks for your input. I don&#039;t see any fundamental problem with the script you have used and I think the answer to your question lies in whether you will be calling multiple functions on page load. You see if you have other functions to call on page load (like for example a script which loads another web service) then using a reusable function like addLoadEvent makes sense. If however you only require a single use then maybe your code will suffice.

Alternatively if you&#039;re using a script library like jQuery then you could simply use the library&#039;s own function, in jQuery&#039;s case - $(document).ready(function() {
   // put all your jQuery goodness in here.
 });

I hope that helps.

Al</description>
		<content:encoded><![CDATA[<p>@Levi &#8211; thanks for your input. I don&#8217;t see any fundamental problem with the script you have used and I think the answer to your question lies in whether you will be calling multiple functions on page load. You see if you have other functions to call on page load (like for example a script which loads another web service) then using a reusable function like addLoadEvent makes sense. If however you only require a single use then maybe your code will suffice.</p>
<p>Alternatively if you&#8217;re using a script library like jQuery then you could simply use the library&#8217;s own function, in jQuery&#8217;s case &#8211; $(document).ready(function() {<br />
   // put all your jQuery goodness in here.<br />
 });</p>
<p>I hope that helps.</p>
<p>Al</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Levi</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-265</link>
		<dc:creator>Levi</dc:creator>
		<pubDate>Fri, 16 Jul 2010 18:55:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-265</guid>
		<description>I meant to say, this is the code I got out of a book. 
The other code is from this tutorial.

if(typeof window.addEventListener != “undefined”)
{
window.addEventListener(”load”, doThisAfterTheHTMLHasLoaded, false);
}
else if(typeof window.attachEvent != “undefined”)
{
window.attachEvent(”onload”, doThisAfterTheHTMLHasLoaded);
}</description>
		<content:encoded><![CDATA[<p>I meant to say, this is the code I got out of a book.<br />
The other code is from this tutorial.</p>
<p>if(typeof window.addEventListener != “undefined”)<br />
{<br />
window.addEventListener(”load”, doThisAfterTheHTMLHasLoaded, false);<br />
}<br />
else if(typeof window.attachEvent != “undefined”)<br />
{<br />
window.attachEvent(”onload”, doThisAfterTheHTMLHasLoaded);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Levi</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-264</link>
		<dc:creator>Levi</dc:creator>
		<pubDate>Fri, 16 Jul 2010 18:50:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-264</guid>
		<description>I tried the code I wrote above and it works in chrome, not sure what version, firefox, not sure what version, and ie6. I still need to test it in ie7, ie8, and safari. My original question should have been: I&#039;m new to javascript, how does the code I posted compare to your code? I usually use the simplest code that will work in the most used browsers. The code I posted I got out of a book. To me it seems simpler and easier to understand. What do you think?</description>
		<content:encoded><![CDATA[<p>I tried the code I wrote above and it works in chrome, not sure what version, firefox, not sure what version, and ie6. I still need to test it in ie7, ie8, and safari. My original question should have been: I&#8217;m new to javascript, how does the code I posted compare to your code? I usually use the simplest code that will work in the most used browsers. The code I posted I got out of a book. To me it seems simpler and easier to understand. What do you think?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Levi</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-263</link>
		<dc:creator>Levi</dc:creator>
		<pubDate>Thu, 15 Jul 2010 21:52:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-263</guid>
		<description>I forgot to say thankyou for this tutorial. Thankyou. I like it</description>
		<content:encoded><![CDATA[<p>I forgot to say thankyou for this tutorial. Thankyou. I like it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Levi</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-262</link>
		<dc:creator>Levi</dc:creator>
		<pubDate>Thu, 15 Jul 2010 21:47:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-262</guid>
		<description>I was wondering if this would work:

function loadGAScript()
{
  if (!document.getElementsByTagName) return false;
  var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
  var gaScript = document.createElement(&quot;script&quot;);
  gaScript.setAttribute(&quot;type&quot;, &quot;text/javascript&quot;);
  gaScript.setAttribute(&quot;src&quot;, gaJsHost + &quot;google-analytics.com/ga.js&quot;);
  var domHead = document.getElementsByTagName(&quot;head&quot;)[0];
  domHead.appendChild(gaScript);
}
loadGAScript();

function callGA()
{
  try
  {
    var pageTracker = _gat._getTracker(&quot;UA-xxxxxxxx-x&quot;);
    pageTracker._trackPageview();
  }
  catch(err) {}
}

function doThisAfterTheHTMLHasLoaded() 
{
  callGA();
}

if(typeof window.addEventListener != &quot;undefined&quot;)
{
  window.addEventListener(&quot;load&quot;, doThisAfterTheHTMLHasLoaded, false);
}
else if(typeof window.attachEvent != &quot;undefined&quot;)
{
  window.attachEvent(&quot;onload&quot;, doThisAfterTheHTMLHasLoaded);
}</description>
		<content:encoded><![CDATA[<p>I was wondering if this would work:</p>
<p>function loadGAScript()<br />
{<br />
  if (!document.getElementsByTagName) return false;<br />
  var gaJsHost = ((&#8221;https:&#8221; == document.location.protocol) ? &#8220;https://ssl.&#8221; : &#8220;http://www.&#8221;);<br />
  var gaScript = document.createElement(&#8221;script&#8221;);<br />
  gaScript.setAttribute(&#8221;type&#8221;, &#8220;text/javascript&#8221;);<br />
  gaScript.setAttribute(&#8221;src&#8221;, gaJsHost + &#8220;google-analytics.com/ga.js&#8221;);<br />
  var domHead = document.getElementsByTagName(&#8221;head&#8221;)[0];<br />
  domHead.appendChild(gaScript);<br />
}<br />
loadGAScript();</p>
<p>function callGA()<br />
{<br />
  try<br />
  {<br />
    var pageTracker = _gat._getTracker(&#8221;UA-xxxxxxxx-x&#8221;);<br />
    pageTracker._trackPageview();<br />
  }<br />
  catch(err) {}<br />
}</p>
<p>function doThisAfterTheHTMLHasLoaded()<br />
{<br />
  callGA();<br />
}</p>
<p>if(typeof window.addEventListener != &#8220;undefined&#8221;)<br />
{<br />
  window.addEventListener(&#8221;load&#8221;, doThisAfterTheHTMLHasLoaded, false);<br />
}<br />
else if(typeof window.attachEvent != &#8220;undefined&#8221;)<br />
{<br />
  window.attachEvent(&#8221;onload&#8221;, doThisAfterTheHTMLHasLoaded);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: K. M.</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-253</link>
		<dc:creator>K. M.</dc:creator>
		<pubDate>Sun, 28 Feb 2010 15:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-253</guid>
		<description>This is G-R-E-A-T great! I just could not hack the script right to make it work in an external .js file, and asking around on Google forums was not helpful.</description>
		<content:encoded><![CDATA[<p>This is G-R-E-A-T great! I just could not hack the script right to make it work in an external .js file, and asking around on Google forums was not helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bobdobbs</title>
		<link>http://www.alstevens.co.uk/a-less-obtrusive-google-analytics-script/comment-page-1/#comment-252</link>
		<dc:creator>bobdobbs</dc:creator>
		<pubDate>Fri, 26 Feb 2010 09:24:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.alstevens.co.uk/wordpress/?p=77#comment-252</guid>
		<description>Hey Aaron.
Thanks for the tecnique.

However, when I put it into place, firebugs console gives me errors.
I suspect that your snippet might not work with the latest version of analytics.</description>
		<content:encoded><![CDATA[<p>Hey Aaron.<br />
Thanks for the tecnique.</p>
<p>However, when I put it into place, firebugs console gives me errors.<br />
I suspect that your snippet might not work with the latest version of analytics.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
