Exclude query parameters in Google Analytics 4

preview_player
Показать описание
Learn how to exclude URL query parameters in Google Analytics 4 with Google Tag Manager.

This will make your reports cleaner.

=== LINKS ===

✭ Blog post: Exclude URL query parameters in Google Analytics 4

✭ GA4 enhanced measurement

⭐⭐ Google Analytics 4 course ⭐⭐


📕 Free e-book: Getting Started with Google Analytics 4

=== CONNECT WITH JULIUS & ANALYTICS MANIA ===

#googleanalytics4 #googletagmanager
Рекомендации по теме
Комментарии
Автор

Thank you for this video. I'm going to hold out and wait to see if Google includes anything to clean up query parameters. This also highlights just how bad GA4 'still' is.

Kielyoutube
Автор

This also works perfectly. I needed to exclude gtm_debug, and fbclid, and I did. Thanks again.

charliesandner
Автор

Nice solution, Julius! Thanks for sharing this.


Rather than overwriting page_location, I opted to store the trimmed URL in a custom parameter instead. That way it keeps the full URL intact (in case you still need to analyze the excluded query params for some reason) but also gives you a 2nd, "cleaner" version to use in content reports. Of course, this doesn't work so well if your website has long URLs (the max length is only 100 characters) or if you've already used lots of custom params for other purposes (you only get 25 total).


Also, just curious if you know of any other GTM templates that use a white list approach instead of a black list? In my experience, the query params you would want to exclude often number in the hundreds or even thousands -- which can make listing them all quite tedious or impractical. By comparison, there are usually only a few parameters (if any) that represent distinct "pages". Plus black lists require ongoing maintenance since new parameters can appear at any point.


Hopefully Google will restore the QP exclusion functionality soon so we don't have to resort to these kinds of workarounds! I'm not holding my breath, though...

boostanalytix
Автор

How can we do the same thing for Events under Reports? In my case, I only have a single link that is not needed from an events report. I want to exclude that specific link from my saved custom event report. I already have a filter, to filter by hostname in my report. But I also need a specific link under this specific hostname to be excluded from being listed.

I am quite surprised that there are no settings to exclude specific links or pages, under the admin properties area....

kensleylewis
Автор

Hi Julius. I think I've found a bug that means *sometimes* the Trim Query variable encodes the URL 2x. This leads to &utm_source becoming &source and as a result utm_source is passed but utm_medium and utm_campaign are not. GA4 doesn't mind but UA will complain about "Missing Campaign Parameters". Have you found this?

JoshuaGeake
Автор

I heard advice not to exclude gclid, but are there other pitfalls trade offs to be concerned with, or params to avoid removing? For example, if I exclude param mc_eid, from Mailchimp, then will I not be able to see what traffic came from mailchimp to judge the effectiveness. Seems like there should be a way to view data by page url WITHOUT the param suggesting it's multiple pages, yet still keep knowledge of all params to slice and dice, compare, etc, as needed. I also see many hubspot tracking codes, such as _hstc, and worry it will make it difficult to monitor goals or performance if these are removed.
Great video by the way. Very helpful.

donrua
Автор

Searched the gallery for 'trim', and searched for another template someone recommended. Neither showed any results. Has Google built an easier way to do this in GA4 now?

donrua
Автор

When testing this in preview mode, the value keeps coming up as the variable's name and not the refined url path. When setting up the tag, I selected the variable and didn't type it in, so it's verbatim and includes {{ VARIABLE NAME }}. Any ideas? So you know exactly what I'm talking about, you talk about this around 6:18 in the video. Thanks!

DH-otze
Автор

Hi congratulations for the videos! A doubt, if I want to exclude only a part of the numbers for example of 10 numbers I want only the last 3, would you like to? How would it be done?

UhPaiCheg
Автор

Hello Julius,

how can I exlude URL query parameters in my Google Data Studio. Some links in Google Data Studio have the ending: ?hss_channel.

I have only found instructions for Universal Analytics and Google Analytics 4 so far. But unfortunately my problem exists also in Google Data Studio. (currently still connected to UA)

Maybe you have some idea?

Kind regards,
Alena

alenaonsocial
Автор

Thanks Julius I found your video's most helpful on all of YouTube! I want to exclude a specific item/product from my purchase events. Can it be done?

JK-prlu
Автор

can i Exclude internal traffic with utm parametrs filters in GA4 ?

Havanasas
Автор

Hello
I have a problem with customer traffic in GA3 IS not working well so I create GA4 there is a huge number between them
I need to know how to contact GA4 with Google adsens because I lost amout if still take data from GA3

samarel-yamani
Автор

how can i enable or setup data layer on wix site

Sabbir.Ahmed.
Автор

Can you suggest a way to aggregate url that contain unique ids? For example /mypage/user/123/edit (I only want to track /mypage/user/edit). I did this with filters in UA. Thx.

RichardViard
Автор

I want to exclude a specific page from conversion tracking. How can I do it in google analytics 4 ?

syedhasnainalishah
Автор

If the URL contains a hash key, then how can we exclude the specific query parameters. I tried your video it is working if the URL does not have the hash key but in my scenario, the URL contains the hash key. Please suggest some solution thanks in advance.

siva
Автор

Great Video, Julius! Did not know this template! I'm getting a lot of page locations with If I add the GCLID to this blacklist, then I will mess all the attribution, right? How can I fix this in the case of GCLID? Thank you!

luiscorreia
Автор

now, with the new Google TAG, it is no longer necessary to enter the same thing in all events, right?

rfelter
Автор

This is super helpful, thanks. Is there a solution to exclude "any" query parameter in case there are unforeseen ones and to avoid having to define them all?

jduhaut
join shbcf.ru