Trying to make sense of query strings in your Google analytics installation can be a headache even for the most savvy GA users. Here we explain what you can do in your GA configuration to make life easier.
If you use query strings on your website (be it for passing session ids or controlling content) your GA reports will contain something like this:

Not very helpful is it! Unless you know exactly what each parameter corresponds to it it difficult to make sense of your data.
Fortunately, there is a way to make sense of this.
How to convert query strings to readable English
This solution won’t work for everyone, but if your website has well written informative page titles (as every good website should!) then this solution might help you make more sense of your data. It involves replacing the messy URLs (shown above) with the page titles by using an advanced filter.
It does more than simply creating another version of the “Content by Title” report, it allows you view readable reports on all aspects of the content!
- Create a test profile for testing this filter
- Click on edit under the profile settings
- In the filters section, click on add filter
- Select create a new filter, give it a name (e.g. replace query string with page title) and select “Custom filter” from the dropdown
- Select advanced filter from the filter type options.
- So fill it out as follows:
The next part is slightly more challenging to get right, but understanding it is half the battle so here is a brief explanation. Basically what you will do next, tells GA to replace what appears in the URI field, with the field name.
Field A = Page title
Extract A = (.*)
Output to = request URI
Constructor = $A1
Select yes under Field A Required
Select no under Field B Required
Select yes under Override Output Field
Select no under case sensitive.

And then click Finish !
That’s all there is too it. Your data should start displaying with page titles in the URI field very soon.
Query string parameters as session ids
Many websites use query strings to store session or visitor ids. These are unique identifiers which provide information on the visitors activities and time on the site.
As these query strings do not contain any information that affects what is displayed on the page, they can actually be completely ignored. In fact it is good practise to do this, if you do not exclude these types of query strings from your site, you end up with a very large number of unique pages, as each session (or visitor etc.) has a different id which will be stored as a different page unless you tell GA to ignore these variables.
Excluding query strings
Fortunately, Google makes it very easy for us to remove these query strings from the data.

In your profile settings, click edit in the main website profile information. This takes you into view the Profile information. In the field “Exclude URL Query Parameters:” type in the name of the parameters you want to exclude. Save your settings, and that’s it!
Don’t forget..
Always create a test profile in GA when you are trying out new things!
That way you don’t lose vital data if you ‘break’ something, and you can tweak things until you are happy it works perfectly.
Update: iQ Content are now Google Analytics Authorised Consultants
Read the announcement of our analytics partnership or an overview of our analytics services
June 27, 2007 at 12:06 pm
Good tip.
Also, in general setting up mod_rewrite or similar so you have cleaner URLs is a good idea too, for all concerned.