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:
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.
- Sign into your Google Analytics account – http://www.google.com/analytics
- At the top of the window click on ‘Admin’
- Under ‘Account’, ‘Property’ and ‘View’ make sure the correct account is selected
- Then click on ‘View Settings’
- 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:
- Click ‘Save’ at the bottom of the screen to save the changes.
- Analytics will now stop collecting the information for the specified query parameters. Please note that past data will not be affected.