How to Exclude URL Query Parameters in Google Analytics

Let's start

 

The problem in hand

Let’s take an example of a single URL to help you understand the actual problem. For example, we have a URL that is

https://marketlytics.com/analytics-faq/exclude-url-query-parameters

Someone lands on our analytics-faq page and enters the term “query parameters” into the search bar. He clicks on the listed options and opens the relevant page. But this time the URL would be

https://marketlytics.com/analytics-faq/exclude-url-query-parameters?rq=query%20parameter

The query string got attached to the URL.

Now, Google Analytics (UA) will detect a unique pageview for this URL. So instead of displaying a single URL, Google Analytics displays two unique pageviews and you will see both the URLs listed in the reports.

Unlike Universal Analytics (UA), where we had to manually remove query parameters from the reports for to avoid duplications, we can easily cater this problem in Google Analytics 4 (GA4) using Page Path Dimension which automatically excludes the query params for us

 

Don't miss out when new resources launch

Our customer analytics experts share wisdom only once a month

Share now
We are customer-analytics consultancy that transforms messy data into actionable insights that will help you grow your company and make better data-backed decisions.