Created
April 16, 2010 18:21
-
-
Save livingston/368765 to your computer and use it in GitHub Desktop.
Optimized Google Analytics Tracker code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optimized Google Analytics Tracker code | |
// http://mathiasbynens.be/notes/async-analytics-snippet | |
var _gaq = [['_setAccount', 'UA-XXXXX-X'], ['_trackPageview']]; | |
// replace XXXXX-X with your tracking id | |
(function(d, t) { | |
var s = d.getElementsByTagName(t)[0], | |
g = d.createElement(t); | |
g.async = !0; | |
g.src = '//www.google-analytics.com/ga.js'; | |
s.parentNode.insertBefore(g, s); | |
}(document, 'script')); | |
//NOTE: Do not use this script in pages which have multiple GA tracking code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment