Edit
Contact us
Salocin Group Leaders in data and AI-enabled connected customer experiences
Edit Engineers of connected customer experiences
Join the Dots Independent, data-led media thinking for sustainable growth
Wood for Trees Optimisers of future fundraising performance
  • Home
  • Our services
    • Cloud solutions
    • Data science
    • Modern Data Platform
    • Privacy and AI compliance
  • Our partners
    • Microsoft
    • Apteco
    • Salesforce
  • Our insights
    • Blog
    • Case studies
    • Reports
    • Webinars
    • Whitepapers
  • About Salocin Group
    • Careers
  • Contact Salocin Group
  • Home
  • Who we are
    • B Corp
    • Careers
  • Our work
  • What we do
    • Intelligent data
    • Marketing technology
    • Transformational CRM
    • Our technology partners
    • Privacy review
  • Our insights
    • Blog
    • Case studies
    • Reports
    • Webinars
    • Whitepapers
  • Contact Edit
  • Home
  • Broadcast media
  • Digital media
  • Print
    • Direct mail
  • Data
    • Our work with Herdify
    • EPiC
  • Media agency
  • Our insights
    • Blog
    • Case studies
    • Reports
    • Webinars
    • Whitepapers
  • About Join the Dots
    • Careers
  • Contact Join the Dots
  • Home
  • Services
    • Actionable insight
    • Data discovery
    • Data engineering
    • Data hygiene
    • Privacy review
  • Products
    • InsightHub
    • Apteco
    • Microsoft
    • Data management
    • Consent and preference management
  • Our insights
    • Blog
    • Case studies
    • Reports
    • Webinars
    • Whitepapers
  • About Wood for Trees
    • Operating principles
    • Careers
  • Contact Wood for Trees
Blog

How to handle URL query parameters in Google Analytics

By Edit | 19 Feb 2018

Do you ever look at your Google Analytics page report and see that your pageviews report has many items for the same page, and you have to filter to get the “real” total value?

The screenshot above shows that /page-1 has 137K pageviews, but a filtered view (including /page-1 and all variants with the ?infinity= query parameters) have a total of 147K pageviews. There are nearly 600 lines of data for just one page because of this query parameter, and the data becomes difficult to read.

Three kinds of query parameters

Before throwing salt and holy water at any query parameter you see in Google Analytics, ask yourself – why does it exist and does it need to be exorcised?

I’ve noticed there are 3 kinds of query parameters:

  • Rubbish query parameters that just pollute the data (e.g. Marketing tags). These allow your analytics software to understand what campaign they are associated with. They (usually) don’t serve a different a different version of the page, and in the URL report should show in one line of data.
  • Less rubbish tags that serve a different version of an existing page (e.g. filters). These tags are things like /bedsheets/?colour=1235. Maybe you want to understand if filters were used (in which case you only need to show two pages: /bedsheets/ and /bedsheets/filtered, for example) or you need to get actual data out of this such as what colour corresponds to “1235”.
  • Not rubbish query parameters that are different pages every time. Occasionally, entire websites are built on query parameters, and each one has a purpose and is an individual page and that’s fine (maybe).

How do I identify URLs with query parameters in Google Analytics?

To find URLs with query parameters in Google Analytics, go to your pages report (Behaviour>Site Content>All Pages) and filter for \?|\= (Regex saying “any page including = or ?). This will give you a list of pages that contain query parameters.

You can then go through your pages (either manually or using Excel’s text-to-columns) to pick out common ones. A query parameter is the string that comes between “?” and “=”.

Make a list of these parameters, determine what function they have, and decide what needs to be done with them. I use three options:

  • Strip from URL
  • Rewrite to be more useful
  • Leave

This can be determined by the role they play on your website. As a rough guide, if a change in query parameter does not change the content on the page, strip it from the URL. If there is some useful information that’s difficult to read, re-write it. If it’s entirely useful, leave as is.

How to remove query parameters from Google Analytics reports

To remove query parameters, go to Admin>View Settings

Under Exclude Query Parameters, add the list of query parameters you would like to exclude (each separated by a comma). Once entered, click save and annotate your timeline to note the query parameter removal.

Note: If you exclude the query parameter, the pageview is still counted but it is attributed to the page without the query parameter.

How to rewrite URL query parameters in Google Analytics

To rewrite URLs in Google Analytics you can use a search-and-replace filter by going to Admin>Filters and creating a new custom filter.

  • Select “Request URI” from the filter field
  • Put the \?[query1,quer2]=.* in the search string where query1 and query2 are the ones you want to replace with useful information
  • Add whatever text you want to see instead of the query parameter in “Replace String”

Save the filter and annotate your changes.

If you have any questions, feel free to contact us.

Share this

  • Email
  • WhatsApp
  • LinkedIn
  • Facebook
  • X (Twitter)

More insights

AI isn’t going to take your job (unless you really want it to) 
Blog

AI isn’t going to take your job (unless you really want it to) 

By Edit | 18 Jun 2024
Customer relationship marketing: How generative AI is revolutionising engagement  
Blog

Customer relationship marketing: How generative AI is revolutionising engagement  

By Edit | 4 Apr 2024
Personalisation as a process
Blog

Personalisation as a process

By Edit | 8 Mar 2024
  • Privacy policy
  • Cookie policy
  • Ts&Cs
  • Report a concern

© 2025 Edit, part of Salocin Group Ltd. All rights reserved. Company no.: 0362​4881. VAT no.: 4208​34911.

Salocin Group Certified B Corporation | Cyber Essentials Certified | British Assessment Bureau, ISO 27001 Information Security Management
Salocin Group
Your cookie preferences

We use cookies to ensure this website functions properly, to analyse website traffic and for marketing purposes.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}