Skip to content

Instantly share code, notes, and snippets.

@padolsey
Created September 14, 2011 21:25
Show Gist options
  • Save padolsey/1217835 to your computer and use it in GitHub Desktop.
Save padolsey/1217835 to your computer and use it in GitHub Desktop.
// Beautiful analytics
var _gaq = [['_setAccount', 'UA-3768993-8'], ['_trackPageview']];
(function(ga, s) {
ga.async = true;
ga.src = 'http://www.google-analytics.com/ga.js';
s.parentNode.insertBefore(ga, s);
}(
document.createElement('script'),
document.getElementsByTagName('script')[0]
));
@padolsey
Copy link
Author

Note: _gaq value is not checked for nor pushed to, so this'll only work correctly if it's the only Google-Analytics code on your page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment