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
Everything found after the question mark ‘?’ it is a query parameter. In our case:
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:
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:
- URL Query Parameters
- 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:
The goal is to hide the query ?lang=EN parameter, in order to switch from this view in the GA report:
to the following view (which makes the analysis easier to do):
HOW TO DO? Within the Google Analytics View, select View Settings:
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:
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:
- Go to the view I want to edit and enter View Settings
- Activate ON under ‘Site Search Settings‘
- Enter the query parameter that indicates the search on the site, in our case ‘s‘
- 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
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.
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:
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:
Good analysis 🙂