If you upgraded your Google Analytics to GA4 there’s a big chance that you are seeing some query strings in your reporting.
Within the GA4 reporting, there is only an option to show your URLs as “Page path + query string and screen class”. Within Universal Analytics, you might have excluded some query strings and parameters from the URL (for example Facebook’s FBCLID parameter).
Removing parameters from GA4
GA4 does not give an option to filter out query strings on the account level.
Luckily, you will be able to do this via Google Tag Manager.
Step 1: Add a custom javascript to GTM
As a first step, you will need to add a custom javascript to your Google Tag Manager.
Go to “Variables” and create a new “User-Defined Variable”. Select “Custom JavaScript” as a Page Variable and copy the following code.
function(){
return document.location.hostname + document.location.pathname;
}
See below what this will look like.

Step 2: Update your GA4 tag
Then, jump into your GA4 tag. Go to “Tags” and select the appropriate tag.
Within “Fields to set” add a row with the Field Name “page_location”. As the value, select the Javascript you just created.

Step 3: Publish your changes
Don’t forget to publish your GTM changes. This will remove any query strings and parameters from your reporting going forward (it won’t change any of your previous data!).