Return to Snippet

Revision: 40159
at January 27, 2011 03:57 by paul66


Initial Code
<!-- asynchronous google analytics change the UA-XXXXX-X to be your site's ID -->
<script>
    var _gaq = [['_setAccount', 'UA-XXXXX-X'], ['_trackPageview']];
    (function(d, t) {
         var g = d.createElement(t),
             s = d.getElementsByTagName(t)[0];
         g.async = true;
         g.src = '//www.google-analytics.com/ga.js';
         s.parentNode.insertBefore(g, s);
    })(document, 'script');
</script>

Initial URL
http://mathiasbynens.be/notes/async-analytics-snippet

Initial Description
Google Analytics is a very popular tool for tracking your website’s user behaviour, and visits. This is simply an optimised version of Google’s asynchronous tracking snippet. To learn what has been optimised, and why it is faster than Google’s own version, follow link.

Initial Title
Optimised Google Analytics

Initial Tags
google

Initial Language
JavaScript