Analytic Misstep Gives Me Hell
Working in the interactive industry has made me impatient, especially with the Web sites of others. The culprit this evening is MTV’s MTVMusic.com.
I was desperate to get my blood pumping and to hear “Gives You Hell” by the All-American Rejects. Yet, as I dropped the URL into the address page, I found myself with an unnecessary pause during initial load because MTV decided to place it’s Google Analytics call at the top of the page.
I ask my Web developers to place analytic calls at the end of a page, before the closing BODY tag in order to avoid page rendering delays. If placed at the top of your HTML it can result in the page hanging a little longer than necessary. But in worst case scenarios you could see a page that does not render at all – resulting in a unhappy consumer and potentially driving them to your competition.
MTV may have reasons for placing the JavaScript call at the top of the page, but even Google recommends adding the tag before the end of the page.
Google Analytics, and other packages, that use JavaScript to track Web site statistics require the piece of code to be executed before anything is logged to the service. However, traditional analytic packages like WebTrends that develop a report off of log file analysis never miss a visitor because every request is logged by the server.
Both methods have pros and cons. With JavaScript implementations a visitor might not be tracked if they leave the page before the code is loaded and executed. With log file analysis you need to make sure that you filter out spiders or internal IP addresses.
So, I’d feel better if MTV followed best practices, but they do have a great site for videos and much of their JavaScript is optimized and compressed, so maybe there is a reason behind the order of execution.

