• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • About
  • Affiliate Disclosure
  • Privacy Notice

Kris Baker

Ecommerce & Digital Marketing Consultant

  • Technical Help
You are here: Home / Technical Help / Strip Query String Parameters to Clean URLs in Google Analytics

Strip Query String Parameters to Clean URLs in Google Analytics

06/08/2019 By Kris Baker Leave a Comment

Multiple URL Query Parameters

Are you seeing what looks like duplicate page URLs in your Google Analytics reports? Have you noticed that some of the URLs look like they are for the same page, but one or more is followed by a string such as ‘?pagenumber=2‘?

If so, you have encountered the wonderful world of query string parameters.

What are Query String Parameters?

Query string parameters are attached to the end of a URL to to alter or define the way in which pages are displayed or search results retrieved for the website user. Examples include pagination, narrowing search results based on specific criteria, and changing the order of the results for the user such as order by price or alphabetically. They can be really useful, and work like a charm for the end user, particularly when sharing or bookmarking specific pages that have been pre-filtered.

Why are Query Strings in Google Analytics a Problem?

The reason you’re probably here is that you’ve been faced with multiple URLs when trying to analyse statistics such as conversion and bounce rates for a specific page in your Google Analytics account.

The issue is that the default setup for Google Analytics treats page URLs containing query parameters as unique pages, even though the page content may remain the same.

The good news is, there’s a relatively easy resolution, but first you need to identify the query parameters used within your website in order to exclude them from being processed by GA.

How to Identify Query String Parameters

If you have been running Google Analytics for a while, your account should have some previous history to work with, so this is a good place to start.

Navigate to ‘Behavior > Site Content > All Pages‘.

Use the search box above the results table to search for ‘?’ (a question mark denotes the start of a query). This will return all URLs where a query parameter has been used to alter page content.

You will notice the parameter immediately follows the question mark, for example ‘?pagenumber=2‘ indicates that the user has navigated to page 2. If multiple parameters have been used, they will be joined with an ampersand (&), such as ‘?pagenumber=2&orderby=price‘. In this example, the user has navigated to page 2 and also ordered the results on the page by price.

If you don’t have enough history in Google Analytics, you can find many of these parameters by navigating through your website and inspecting the URLs that appear in the address bar in the process.

Excluding Query String Parameters from Page URLs

To stop query parameters from appearing in your page URLs, you will need to edit the View Settings of your particular property, however I would recommend you do this in a ‘test’ view first.

  1. Navigate to ‘Admin’
  2. Choose the correct Account, Property and View. (Do this in a test view first)
  3. Click ‘View Settings’
  4. Navigate to the ‘Exclude URL Query Parameters’ field.
  5. Include each parameter in the field, separated by commas.
  6. Click Save

Excluding Site Searches

If your site has a search facility, you may also need to enable ‘Site search Tracking’ which will allow you to exclude site searches from your page URLs in your reports.

Enter the search query parameter in the ‘Query parameter‘ field, and then choose whether you wish to strip these parameters from the URL.

Site searches are normally identified with ‘q‘ or ‘s‘ query parameters, but every site can vary, so do your own research on this.

Note: If you strip site search query parameters from the URL, you will still be able to view all of your website searches under ‘Behavior > Site Search > Search Terms‘.

Identifying Site Search Category Parameters

Another feature also allows you to identify the category parameter within the URL and exclude it from page URLs. A category parameter is used in advanced search to filter searches to specific product categories.

Once the category parameter is added, you will also be able to see these categories inĀ ‘Behavior > Site Search > Search Terms > Site Search Category‘.

The Result

Here’s an example view with multiple URL query parameters excluded, site search query parameter stripped and the category parameter identified and stripped also.

Strip and Exclude Query Parameters in Google Analytics

Related

Filed Under: Technical Help Tagged With: Google Analytics, Query Parameters

About Kris Baker

Website and digital marketing consultant.

Reader Interactions

Leave a Comment Cancel reply

Primary Sidebar

Join My Email List

Join my email list to receive my latest content as soon as it's published, right to your inbox. I publish a maximum of one article per week, and you will always have the option to unsubscribe.

Recent Posts

  • Strip Query String Parameters to Clean URLs in Google Analytics
  • Fix Duplicate Page URLs in Google Analytics with Trailing Slash
  • Solved: Cannot Delete Files from Windows 10 Desktop (Files Blocked)
  • Validate Email Addresses In Microsoft Excel
  • Jetpack Causing Duplicate Meta Descriptions? Here’s the Fix!

Recent Posts

Multiple URL Query Parameters

Strip Query String Parameters to Clean URLs in Google Analytics

Google Analytics running on a laptop.

Fix Duplicate Page URLs in Google Analytics with Trailing Slash

OneDrive Blocking Windows File Explorer Delete

Solved: Cannot Delete Files from Windows 10 Desktop (Files Blocked)

Recent Comments

  • Kris Baker on Fix Duplicate Page URLs in Google Analytics with Trailing Slash
  • Michelle Longwell on Fix Duplicate Page URLs in Google Analytics with Trailing Slash

Archives

  • August 2019
  • May 2019
  • February 2019
  • March 2018

Categories

  • Technical Help
  • Tips & Tricks

Copyright Kris Baker© 2021

We use cookies to give you the best experience on our website.

You can find out more about which cookies we are using or switch them off in settings.

Kris Baker
Powered by  GDPR Cookie Compliance
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

3rd Party Cookies

This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.

Please enable Strictly Necessary Cookies first so that we can save your preferences!