English Posts

Query Parameters and Google Analytics

In this post we will see what query parameters are and what can happen in GA Reports if you do not set the settings correctly for these values.

I’ll show you how to exclude them step-by-step in Google Analytics to allow you to have a clean data collection and facilitate the analysis of the website.


What are query parameters

Let’s take an example of URL

https://www.example.com/categoria-uno?banner=home_page

Everything found after the question mark ‘?’ it is a query parameter. In our case:

?banner=home_page

What are query parameters for? They are useful for decorating a website’s URLs and making site analyzes more effective.

In the example shown, the query parameters indicate that the page called ‘category-one‘ was viewed by clicking on a banner on the home page. By clicking on that banner, the landing is: https://www.example.com/categoria-uno?banner=home_page

How do I view this data in Google Analytics? If we go to the Google Analytics report, Behavior – Site Content – All Pages, I will display this data:

query parameters

In the Page dimension there are two URLs, which however refer to the same page called ‘categoria-uno’, forming different cardinalities. This is because Google Analytics considers these two different URLs, since they have different query parameters.

There are several query parameters, such as those for Marketing including the UTM parameters that are useful for traffic analysis, or there are more technical parameters that can be used for the Cross Domain tracking etc.

However, it is necessary to differentiate the query parameters useful for web analysis and those useful for website implementation. For qualitative web analysis it is useful to filter the least useful query parameters.

Let’s see how to filter the query parameters in Google Analytics, dividing them into:

  1. URL Query Parameters
  2. Search Query Parameters

1. URL Query Parameters

Let’s start from a goal: suppose we want to exclude the query parameters in the URLs and which are not useful for analysis.

Let’s imagine we have this URL:

https://www.example.com/blog-post-prova?lang=EN

The goal is to hide the query ?lang=EN parameter, in order to switch from this view in the GA report:

page dimension analytics

to the following view (which makes the analysis easier to do):

dimension page with query

HOW TO DO? Within the Google Analytics View, select View Settings:

view settings google analytics

Go to the Exclude URL Query Parameters tab and enter the query parameter that I want to exclude. In our case I have to enter lang and save:

ATTENTION: the values ​​you type into are case sensitive so writing ‘lang’ and writing ‘Lang’ is not the same thing!

If there are more values ​​to type into, it can be done by entering one value after another, separating it from the comma (,) without any space. The limit of characters that can be entered is 2048.

2. Search Query Parameters

Among the query parameters that can be modified within the Google Analytics settings, there are also the search parameters. These are query parameters relating to the search for keywords on the website.

For example, if I search for the word ‘allerte‘ by typing it in the internal search engine bar, the URL that will be created when I click ‘Enter’ will be the following:

https://dataenthusiast.it/?s=allerte

search query parameters google analytics

In this case the query parameter is a value related to the search on the site, for this we speak of Search Query Parameters, which in our example is formed by: ?s=

For these values ​​I can:

  • exclude ‘s’ queries
  • make GA collect and display the keywords most searched by users on the website

To do this, I have to follow the following steps:

  1. Go to the view I want to edit and enter View Settings
  2. Activate ON under ‘Site Search Settings
  3. Enter the query parameter that indicates the search on the site, in our case ‘s
  4. Flag the tab ‘Strip query parameters out of URL‘: in this way we tell GA to eliminate the indicated query parameter (‘s’) from the URLs
site search tracking google analytics

Save it.

In this way there will be no duplicate URLs from the query ‘s’ parameter within the Page dimension and all the words searched by users on the website will be collected within the Report Behavior – Site Search – Search Terms.

site search report analytics

TIP: create a filter to transform the words searched by the user on the website into lowercase. Create a new Filter in the View that interests you (or in the Property if you want to use the same filter faster for multiple views) and then give it a name, e.g. ‘Lowercase on Search Terms‘, choose Custom, select Lowercase and Search Term and save, as in the image below:

lowercase search terms filter analytics

With this filter you will avoid finding the same word repeated in multiple cardinalities, but it will be collected under the same entry in lower case (lowercase precisely), facilitating the analysis:

avoid duplication search terms

Good analysis 🙂


You may also be interested in these articles:

How to track Single Page Applications with Google Tag Manager

How to solve the 5 million cell limit in Google Sheets

Cardinality dimensions in Google Analytics

The value (other) in Google Analytics

Lascia un commento

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