Created
February 27, 2010 22:37
-
-
Save stevenwilkin/317020 to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* initialise Google Analytics without having to slow down page load with adding script tags in layout | |
*/ | |
function initAnalytics(){ | |
var accountId = 'UA-XXXXXXX-X'; | |
jQuery.getScript('http://www.google-analytics.com/ga.js', function(){ | |
try { | |
var pageTracker = _gat._getTracker(accountId); | |
pageTracker._trackPageview(); | |
} catch(err) {} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment