How to Exclude URL Query Parameters in Google Analytics

Last Updated: May 24, 2022

When you navigate to Google Analytics Admin, you see the option to change view settings:

view settings 2

One of the view settings is ‘Exclude URL Query Parameters‘:

exclude url query parameters

A query string is the part of the URL which comes after the ‘?’ character.

For example in the URL:

The query string is:


The query string is made up of one or more parameters (called query parameters) and each parameter is made up of ‘key=value’ pair.

For example in the URL:

The query string is:


This query string is made up of the following two query parameters:



The query parameter ‘ThemeId=8904’ is made up of the key called ‘ThemeId’ and the value called ‘8904’

By default Google Analytics treat same page as two different web pages, if they contain different query parameters.

For example, for Google Analytics the following two web pages are different (even if they display, exactly the same contents):

If a query parameter doesn’t change the contents of a web page then you should exclude it from your GA reports via the ‘Exclude URL Query Parameters’ feature.

Failing to do so, will result in multiple entries being reported for the same page in your GA reports.

For example, if the following two pages display exactly the same content:

Then GA may report traffic to these pages like the one below:

report traffic

Once you exclude the query parameter ‘ThemeId’:

exclude theme id

Then Google Analytics will consolidate the traffic of the two pages and may report the traffic as:

report traffic2

Now imagine your website is using thousands of different query parameters for the same page.

In that case, without excluding query parameters, you would see thousands of different entries for the same page in your GA reports.

How to find the list of query parameters to remove from your GA reports?

Follow the steps below:

Step-1: Ask your web developer to send you a list of query parameters that are being used on the website but which do not change the contents of a web page.

Step-2: Make sure that you have got a Google Drive account and access to Google spreadsheet App

Step-3: Login to your Google Drive account via your Google Login.

Step-4: Install the Google Analytics Spreadsheet Chrome extension.

Step-5: Navigate to Google Analytics Exclude URL Query Parameters Worksheet and then make a copy of it (by Clicking on the File menu > Make A copy):

make a copy

Step-6: Click on the ‘OK’ button:

copy document

Step-7: Click on the ‘Report Configuration’ tab at the bottom of the Google sheet:

report configuration tab

Step-8: Navigate to the main reporting view of your Google Analytics property.

Step-9: Navigate to the ‘Admin’ section and then click on ‘View Settings’:

view settings 2

Step-10: Copy your view id:

view id

Step-11: Navigate back to the ‘Report Configuration’ tab of your Google Sheet and then paste your view id in the yellow coloured cell, immediately after the ‘ga:

copy paste view id

Step-12: Modify the Last N Days value to 30 days:

last n days

Step-13: Navigate to Add-ons menu > Google Analytics > Run Reports

run reports

Step-14: Click on the ‘Continue’ button:

updated add on

Step-15: Select and click on your Google Analytics account:

choose an account

Step-16: Let Google Analytics access your Google Account by clicking on the ‘Allow’ button:

ga want to access

Step-17: If you see ‘upgrade notice’ then click on the ‘ok’ button:

upgrade notice

Step-18: You should now see the ‘Report Status’ message box. Click on the ‘ok’ button:

report status

Step-19: Navigate to the ‘Unique Query Parameters‘ tab of your Google Sheet:

unique query parameters tab
mark yes

Step-20: Mark “YES” (by selecting it from the drop-down menu) next to each query parameter you would like to exclude from your GA reports:

Step-21: Once you are done, copy the value of the yellow cell:

copy yellow cell value

Step-22: Paste the value of the yellow cell into the “Exclude Query Parameters” field in your View settings in Google Analytics:

exclude url query parameters2

Step-23: Click on the ‘Save’ button.

CAVEAT: Do Not Exclude ‘Search Query Parameters’

Do not exclude ‘search query parameters’. Otherwise you won’t see any data in your ‘site search’ reports:

site search reports

Introduction to Search Query Parameters

When users search on your website (via the search box):


their queries are usually included in the URL.

For example, if you search for ‘enhanced ecommerce basics’ on, you would see ‘s’ (search query parameter) followed by your query:

search query parameter

If I exclude this search query parameter from my GA reports:

exclude search query parameter

Then GA will not be able to capture any site search data in my reports.

If you are not sure, what your site search query parameter looks like then ask your web developer.

If you want to include site search data but still remove search query parameters from your GA reports, then follow the steps below:

Step-1: Turn ‘Site search Tracking’ (under ‘View Settings’) to ‘ON’:

site search tracking google analytics

Step-2: Enter your search query parameter(s) in the ‘Query parameter’ text box:

query parameter text

Note: You can enter up to 5 search query parameters separated by commas. Also, remember that search query parameters are case sensitive.

Step-3: Select the checkbox ‘Strip query parameters out of URL’:

strip query parameters out of url

Step-4: Click on the ‘Save’ button.

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."

Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.


My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder,
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade

Learn and Master Google Analytics 4 (GA4) - 126 pages ebook

error: Alert: Content is protected !!