Skip to content

Instantly share code, notes, and snippets.

@RedWolves
Created December 4, 2009 23:26
Show Gist options
  • Save RedWolves/249453 to your computer and use it in GitHub Desktop.
Save RedWolves/249453 to your computer and use it in GitHub Desktop.
Google Analytics that uses Steve Souders async loading techniques
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') +
'.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment