Google Analytics – How to exclude query parameters

One of the key bits of information Google Analytics collects is the URL that was loaded.

Sometimes a URL may have one or more query parameters, for example:

www.domain.com/?query1=1&query2=2&gf_token=123

By default Google will collect the full URL with all the query parameters.

Sometimes this is useful, for example if the query parameter shows search terms people use in your website – and sometimes it can be bad, creating duplicate page loads in your Analytics data or even worse including personal identifiable information.

If you do not already know, the terms of service for Google Analytics makes it critical that personal identifiable information is never collected through Google Analytics.

The following steps detail how to exclude specific query parameters from being collected by Google Analytics. In this example we will be excluding the gf_token query parameter – which is used by the WordPress Gravity Forms plugin.

  1. Sign into your Google Analytics account – http://www.google.com/analytics
  2. At the top of the window click on ‘Admin’
  3. GoogleAnalytics-ExcludeQueryParameter1
  4. Under ‘Account’, ‘Property’ and ‘View’ make sure the correct account is selected
  5. Then click on ‘View Settings’
  6. GoogleAnalytics-ExcludeQueryParameter2
  7. Now under ‘Exclude URL Query Parameter’ enter the query you want to exclude. Additional query parameters can be added by separating with a comma. For example:
  8. gf_token,query1,query2
  9. GoogleAnalytics-ExcludeQueryParameter3
  10. Click ‘Save’ at the bottom of the screen to save the changes.
  11. Analytics will now stop collecting the information for the specified query parameters. Please note that past data will not be affected.