English PostsGoogle Analytics

Find Query Parameters on Google Analytics

In this post I’ll deep dive into how to find and to exclude query parameters from your website.

It is important to check this inside your Google Analytics, to avoid duplications into the Reports (how I described in this post) and to reduce the number of cardinalities of some dimensions, so that it will be easier to analyse your website’s data.

There are a bunch of query parameters that are broadly common (fbclid, gclid, mc_cid, mc_eid, msclkid etc.), but it is not enough copy and paste them into your View settings.

Every website has its own characteristics.

This is the reason why it is important to identify those present on your website and therefore selectively exclude them .

Let’s take a look on how to do that.

Find the query parameters

First thing to do: check if there are some pages on your website decorated with the query parameters.

Go to Behavior – Site Content – All Pages Report and insert into the filter the question mark ‘?’.

In this way you will find all the pages with the query parameters:

google analytics report

Once you have found them, you have to use the advanced filter option and exclude every cardinality.

In my example, the filter has to be set up in this way:

  • Include – Page – Containing: ? (in this way you can see all the pages that have the question mark in the URL)
  • Exclude –Page – Matching RegExp: customize_|fbclid (we exclude the pages that contain ”customize_” or ”fbclid”)
advanced filter analytics

Apply the filter and you’ll see nothing: no more results.

filter

That means, for the selected time period, there are no more pages that contain query parameters.

Now that we know our query parameters, we have to grab and bring them back ino the exclusion list within the View settings.

Let’s copy the content of the filter (customize_|fbclid):

copy filter

Go to the Admin section in your Google Analytics. Select the View where you want to exclude the query parameters you have found.

I always suggest to test everything into the Test View before validate any solution.

Go to the Exclude URL Query Parameters and paste the content copied from the filter. Remeber two important things:

  1. you have to change the pipe symbol | with the comma : pipe symbol meant ”or” in the Filter (the format was a Regular Expression);
  2. everything you write in this section is case-sensitive: it will be excluded all that it is written and how it is written. If you write it in lowercase, the lowercase word will be excluded.

Save it.

You have excluded the query parameters from your website. Another way to do that, it might be use the Filters in the Account Settings.

This could be a good solution for large websites, with high volume of traffic and/or with multiple properties.


You may also be interested in the following 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 *