5.4K members online now
5.4K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
Guide Me

Putting URL encoding in Search String

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

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?

1 Expert replyverified_user
Marked as Best Answer.
Accepted by topic author Alan H
May 2016

Re: Putting URL encoding in Search String

[ Edited ]
Top Contributor
# 2
Top Contributor

Hi :-)
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=something and you use a filter to change it to/section1?parametera=something for your reports, then when you identify the query parameter here, you need to identify it as ParameterA


Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here