Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Analytics and the __utm.gif file

When using Google Analytics and using the newer ga.js file, is the __utm.gif file needed in your root directory of your web site?

I do see a call being made from my browswer to the file on google-analytics.com (http://www.google-analytics.com/__utm.gif?...), but in the past I was told that it needed to exist in the root of the site.

Does this still hold true?

Could you please provide a reference?

like image 299
Matt Sidesinger Avatar asked Aug 04 '09 13:08

Matt Sidesinger


1 Answers

If you are using the new version of the tracking code (ga.js), the only thing you need to do is include this snippet of JavaScript:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
</script>

This would imply that there are no requirements for you to host any __utm.gif file on your server (I'm not sure how this would even work for analytics anyway, as the whole point is for the client's browsers to make requests to Google's servers).

like image 156
matt b Avatar answered Sep 22 '22 14:09

matt b