My page is always stuck at "Waiting for www.google-analytics.com" for a few seconds and this blocks any document-ready handler from running. There is a alternative way to load ga.js so this is not a problem: http://beepinteractive.com/2008/07/02/adding-google-analytics-onload/
Is it possible to implement this as an option so people can choose the google way or use this alternative way?
Comments
Comment #1
hass commentedNo, we do not implement other solutions like the ones Google supports. It would also break the GA code validation that Google is recurrently doing.
Otherwise this would end up with support requests to this queue and this makes no sense. "Local caching" option of the GA code may help with this issue. Try it out it's already there. Aside this example is based on the monster library YUI. Adding this library would slow down your page loading dramatically - much more than the temporarily issue you have seen. Aside - I do not think that this change would change anything on the loading delay.
Comment #2
mattyoung commented>"Local caching" option of the GA
I enabled the "Cache tracking code file locally" option under "Advanced Settings". This eliminated the delay. The key is the elimination of:
This code is synchronous and blocks any onload handlers from executing until it's finish loading. Maybe document this in README.txt or the project page?
>Aside this example is based on the monster library YUI
Just FYI, the second example does not depend on any thing else and can be changed to use jQuery.