GA4 - How to clean URL parameters

As we explained in this other blog post sometimes url parameters can give us big problems with cardinality in data and especially now in GA4.

 

Remember that in GA4 high cardinality of data can cause you to run into lines like this in your reports both defaults and scans:

 

GA4 Cardinality

 

Cardinality is the number of unique values assigned to a dimension. There are dimensions with a fixed number of unique values (e.g. Weekday, Device) and others can have a high cardinality (e.g. page path, transaction ID). If a dimension takes more than 500 values per day, it will be considered by GA4 as a high cardinality dimension.

One of google's recommendations to avoid encountering cardinality is to "Limit the collection of data especially those with high cardinality (Ex: URLs or url parameters)". Ya.

But you will agree that many times that cardinality in urls comes from external agents that do not depend on us and that also coincide with ad platforms... Do these url parameters sound familiar to you?

fbclid=oiekhakjdvnkajsd089237498

creative=luesfglknadsnadsnlad989867983

If you run ad campaigns on Google Ads or Meta they are sure to ring a bell

We are going to explain you a way to clean up all those parameters of the urls.

 

The first thing is to identify those parameters.

    1. Create a new scan in GA4.

    2. Add the page path + query string dimension and the views metric.

    3. Apply a filter to the table where the page path dimension contains "?", by default the table displays 10 rows, extend the table to 50 or 100 rows.

GA4 - Exploration query parameters

Now that you know what parameters you want to exclude you go to GTM to the container that manages that property:

  1. Click on Templates and then Search Gallery. GTM - Template & Gallery

  2. In the gallery search engine type Trim Query and click on the solution that appears GTM - Search Template

     

  3. Click on Add to Workspace GTM - Add Template to WS

     

  4. Click Add GTM - Add Template confirm

     

Let's create a new variable:

  1. Go to variables and click on create new.

  2. Under variable type select Trim Query 

  3. Under target URL drop down and select Page URL. By default Queries is selected, if it is not, select this option.

  4. In Add Row add one by one the parameters you want to clean up from the list extracted from GA4.

  5. When you are done click Save. GTM - New variable

And now let's apply this variable. You have two options:

  • You go to each of the GA4 GTM tags and add a new parameter that overwrites the page_location with the variable you just created GTM - Add parameter to tag config
  • Create a new variable of type Tag Event Settings and apply it on all event tags . GTM - Tag events settings

And for the moment this is the best way to clean up those annoying urls that can also cause cardinality problems in reports.

And for the moment this is the best way to clean up those annoying urls that can also cause cardinality problems in reports.

If you want another day we will explain you how to clean this but in your Looker Studio reports.

ANTERIOR
SIGUIENTE

TIPS DE EXPERTOS

Suscríbete para impulsar tu negocio.

ÚLTIMOS ARTÍCULOS

How to Stay Ahead in the Age of Automation

Automation and Artificial Intelligence (AI) are rapidly transforming the way we work and live. While many people fear that these technologies may replace their jobs, the real threat lies in inaction and failure to adapt. In this article, we will explore how we can adopt a positive perspective on automation and how companies, whether B2B or B2C, can apply these technologies to drive growth and efficiency.

Amazon revolutionizes the AI landscape with Nova Act.

In the ever-evolving world of artificial intelligence, Amazon has taken a bold step with the launch of Nova Act, a revolutionary platform designed to transform how we interact with AI in the web environment. This innovation not only empowers developers but also opens new possibilities for both B2B and B2C companies.

The Growing Importance of Deepfake Detection Solutions

In today's highly interconnected world, the line between what is real and what is fake is becoming increasingly blurred. This blending of authentic and digitally created content has led to a growing need for advanced deepfake detection solutions. But what opportunities and challenges does this present for businesses? How can these solutions be implemented to maximize their positive impact? Here, we explore these questions with a forward-thinking approach, examining use cases applicable to both B2B and B2C sectors.

Revolutionary Advances in Artificial Intelligence and Biotechnology

The Ever-Changing Landscape of Technology

We are witnessing revolutionary advancements in Artificial Intelligence (AI) and biotechnology. These fields are not only transforming how we interact with the world but also unlocking new opportunities for both B2B and B2C businesses. Below, we explore some of the most promising applications and how large companies can implement them to maximize their potential.

data
Mallorca 184, 08036
Barcelona, Spain