Skip to content

Instantly share code, notes, and snippets.

@dstrelau
Created February 11, 2010 20:46
Show Gist options
  • Save dstrelau/301933 to your computer and use it in GitHub Desktop.
Save dstrelau/301933 to your computer and use it in GitHub Desktop.
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
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">
try {
var pageTracker = _gat._getTracker("UA-XXXXX-X");
pageTracker._trackPageview();
} catch(err) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment