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

CRO at Adobe Target: type of activities

Adobe Target is Adobe Experience Cloud's CRO tool, which allows you to customize your website, mobile apps and other devices to enhance, personalize and optimize the user experience.

Looker Studio: Email Access Restriction Step by Step

Have you ever contemplated the idea of restricting access to certain data within your Looker Studio dashboard? In this article we'll explain how to limit access by using email filters, ensuring that only certain users have access to specific information.

Planning necessary migrations between HubSpot accounts

Migrating between HubSpot accounts can seem like a complex task, both technically and organizationally, so proper preparation is done to make the migration a success. This migration process is executed in scenarios such as consolidation between multiple accounts, restructuring a business, or moving data to a more advanced account.

Migration between HubSpot accounts can seem like a complex task, both technically and organizationally.

How AI affects the role of the salesperson

In a world where digital transformation is our daily bread, artificial intelligence (AI) has become a fundamental pillar for sales strategies. As a specialist sales consultant, I am experiencing firsthand how AI is redefining the role of account executives, opening up a range of opportunities and challenges.

data
Mallorca 184, 08036
Barcelona, Spain