In a previous post I mentioned that Google Analytics now offers an installation guide to help users hit the ground running. To further help GA user’s I’m writing a number of posts about common installation and configuration issues. Stuff that I encounter often.
Today I’m going to talk about dynamically generated websites. Dynamic websites use query string variables to change the content that is displayed in the browser. What’s a query string variable, you ask? Query string variables appear in a URL after the question mark. Here’s an example. The query string variables are bolded in the URLs below.
Dynamic websites use query string variables to change the content displayed to the site visitor. The site visitor may request the index.php page 10 times but receive different content in the browser window each time the page loads because the query string variables change with each request. Dynamic sites are usually programmed in a language like PHP, .NET, ColdFusion or Java.
So why does all this matter to Google Analytics? It is important to understand what Google Analytics considers a unique website page. When a user lands on a page the urchin.js tracking code collects the value that is in the location bar of the browser. It then strips off the domain name and considers the remaining string a unique page on the website. This string includes all of the query string variables. Here’s an example.
In the above URL Google Analytics would log a hit for /shirts/index.php?aid=123 in your reports. The query string variable aid=123 is important because it indicates the content that was shown to the visitor. If you are the site owner aid=123 will probably mean something to you.
If you have a dynamically generated site you really don’t need to do anything to your GA configuration. As described above, GA uses all of the query string variables when creating unique page names.
But what if you have a large number of query string variables that are not relevant to the content being display? You can configure each GA profile to exclude certain query string parameters when creating unique page names. This setting is found in the ‘Main Website Profile Information’ section of the profile settings. Simple list all of the query string parameters that you want GA to ignore.
Analyzing your query string parameters and excluding the irrelevant ones is a very important step in configuring your profile. Here’s why. Imagine that every visitor to your website has a unique identifier in the query string. That means that there will be a huge number of unique URLs that really aren’t unique. Your reports will be filled with useless data. Make sure you configure your profile to exclude all session identifiers from the query string variables.