English Posts

Search and Replace Filter in Google Analytics

search and replace filter in google analytics

Google Analytics gives you the possibility to use Filters to clean and better organize your data. This can help you a lot for your analysis.

Among the different types of filters, Search and Replace Filter allows a convenient help to substitute a value with another one more useful and, above all, more readable.

Want to know more about how to use filters in GA? Read this.

Create the filter

Let’s go in Admin – View (choose the view where you want to apply the filter) – Filters and create a new one.

Let’s suppose that GA is collecting data from your domain both with www. and without www. .

To avoid this and reduce the number of cardinality, making your analysis more qualitative, we create the following filter:

  • Filter name: Search & Replace www.
  • Filter type: Custom
  • Search and Replace
  • Filter Field: Hostname
  • Search string: ^esempio\.it$
  • Replace String: www.esempio.it
search and replace filter in google analytics

Save it.

In this way, Google Analytics will only show us the value www.esempio.it every time it finds a value that starts and ends with ‘esempio.it

This is the reason why I type, thanks to the Regular Expressions, this: ^esempio\.it$

Other examples

As you’ve seen, the purpose of the Search and Replace Filter is to find a value and replace it with another one that you indicate.

For this reason, there are as many application cases as can be useful for your work.

For example, this filter can also be useful to correct any spelling mistakes when you or some of your collaborators fill in the utm parameters for campaigns.

We can create a filter that corrects the (misspelled) ‘affilaite‘ value with the correct ‘affiliate‘ value.

Simply create a filter with the following rules:

  • Filter name: Search & Replace affilaite
  • Filter type: Custom
  • Search and Replace
  • Filter Field: Campaign Name
  • Search string: affilaite
  • Replace String: affiliate
search and replace filter with misspelling

Having the possibility to choose the dimension type, both native and custom, you have lot of possibilities to use this filter.

The main advantage of the Filters is that you can manage them both in the View and into the Account.

filters in admin analytics

Good analysis! 🙂


You may also be interested in the following articles:

How to solve the 5 million cell limit in Google Sheets

How to track Single Page Applications with Google Tag Manager

Query Parameters and Google Analytics

Tracking Google Data Studio Dashboards with Google Analytics

Schedule Emails in Google Data Studio

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *