Asynchronicity

Be sure to check out Steve Souders's latest blog post. In it, he stresses the importance of deferring JavaScript until after a pages have rendered and all the work that still needs to be done when it comes to high performance JavaScript.

Google made "asynchronous" the new marketing industry BUZZ word for 2010 when they rolled out an asynchronous version of Google Analytics. Asynchronous scripts are still just scripts after all and not bulletproof. Asynchronous Google Analytics isn't an open license to do as you please. Over the past year, I've noticed a major increase in the number of "mavericky" asynchronous Google Analytics implementations. When implemented properly Google Analytics is a great tool but implementation is critical.

Simply adding ASYNC attributes doesn't "make" scripts asynchronous. "_gaq" is actually what makes Google Analytics ASYNC syntax possible. Unfortunately, few browsers support the ASYNC attribute. Either way, ASYNC scripts are executed upon response arrival and not deferred which can result in blocking. DEFER attributes on the other hand, can block the onload event and also decrease PageSpeed. Another point to consider when trying to get content in front of users more quickly is, "If asynchronous scripts arrive while the page is loading, the browser has to stop rendering in order to parse and execute those scripts."

Bottom line, "mavericky" implementations can actually have a negative impact on user experience. Even worse, this data can be missing from both analytics and the Google Webmaster Tools site performance tab depending on how onload event firing is impacted. Oh yeah, and don't forget rankings! Matt Cutts said, Google Analytics doesn't impact rankings because when properly implemented it waits to load scripts until after the onload event but, that may not be the case if improperly implemented. Maile Ohye has confirmed that one of the ways Google calculates performance is via the onload event. According to Google, "To ensure the most streamlined operation of the asynchronous snippet with respect to other scripts," the asynchronous snippet should either be placed just before the close of the HEAD tag or just before the close of the BODY tag in your (X)HTML document. I'd suggest not taking any chances this Holiday season because this year speed is more important than ever before and testing.