Putting URL encoding in Search String
I'm trying to create a filter to remove certain query parameters (AuthKey) from the logged pages in Google Analytics.
My URL is displayed in the form of URL encoded values, such as:
I have inserted a Filter with the following configuration:
- Custom: Search and Replace
- Filter Field: Request URI
- Search String: (AuthKey=[^&]*&?)
- Replace String:
However, the filter doesn't seem to work. Does this mean that I have to URL encode my search string as well?
Re: Putting URL encoding in Search String[ Edited ]
May 2016 - last edited May 2016
Filters won't work on historical data, they only work going forward from the time they are applied
Rather than using a filter, under the Settings page for each View, there is an option to Exclude URL query parameters.
As with a filter, this will fix the issue going forward.
- Exclude URL Query Parameters: Any query parameters or unique session IDs (e.g., sessionid or vid) that appear in your URLs that you do not want to see in your reports. Enter as a comma-separated list.
This setting is case sensitive. There is a 2048-character limit.
Additionally, the parameters you identify here are excluded before filters are applied, so be sure you identify them here as they appear in the original, unfiltered URIs. It has become a common mistake to apply filters, and then return to these settings to identify query parameters as they appear in your filtered reports, thus ignoring the case-sensitive requirement of this setting.
For example, if the original URI is
/Section1?ParameterA=somethingand you use a filter to change it to
/section1?parametera=somethingfor your reports, then when you identify the query parameter here, you need to identify it as
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here