In my last post, I tackled setting up search and replace filters in Google Analytics. But today, I thought we needed a simple post about installing the code correctly and efficiently for those just getting started.
"There's no need for such a post," some might say, "why not just follow Google Analytics' instructions when setting up a new account; it's foolproof."
"Au contraire," I reply, "follow Google's instructions if you want to frustrate your web developers with getting in and out of the code multiple times, follow my instructions if you want to be ready for the future."
The Myth about the Default Google Analytics Installation
After creating a new profile (which you still need to do btw) the instruction page says:
"Copy the following code block into every webpage you want to track immediately before the </body> tag."
The reason Google says to do this is so that all of the content on your page loads first, and then the tracking code executes. This is a nice gesture; Google doesn't want their code to hindering your visitors from seeing the content on your site in the event all of their 1 million servers go down. However, such an installation can hinder YOU down the road from taking advantage of additional features.
A Healthy Example
Say you follow Google's default method. Then, you want to track the number of downloads to a whitepaper or clicks to a third-party site. You must move the default code to a new location. If you're paying web consultants every time they touch your code, this can become costly, especially if they have to re-install the code on every page.Install the Code Efficiently The First Time
Instead of placing the code immediately before the </body> tag, place it either: - just BEFORE the closing
</HEAD>tag, OR - just AFTER the OPENING
<body>tag.
Google eventually suggests this method for those that want such ability down the road, but why not get all of the Internet marketing benefits that you can by making one small step in the beginning?
It could really save you down the road; happy analyzing.
Still Having Trouble?
Read Google's good Help doc: Why Isn't Google Analytics Tracking My Website? and/or Watch the video below:








Comments for How to Install the Google Analytics Javascript Code for an Efficient Web Based Strategy