Created
September 30, 2013 14:39
-
-
Save simondahla/6764758 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
var startTime;function loadJs(url, callback) { var js = document.createElement('script'); js.async = true; js.src = url; var s = document.getElementsByTagName('script')[0]; js.onload = trackTimingCallback; startTime = new Date().getTime(); s.parentNode.insertBefore(js, s);}function trackTimingCallback(event) { var endTime = new Date().getTime(); var timeSpent = endTime - startTime; ga('send', 'timing', 'jQuery', 'Load Library', timeSpent, 'Google CDN'); // Library has loaded. Now you can use it.}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment