How to Exclude URL Query Parameters in Google Analytics?

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

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

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

For example in the URL:

https://www.abc.com/fold1?ThemeId=8904&iPathId=38715

The query string is:

ThemeId=8904&iPathId=38715

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:

https://www.abc.com/fold1?ThemeId=8904&iPathId=38715

The query string is:

ThemeId=8904&iPathId=38715

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

ThemeId=8904

iPathId=38715

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):

https://www.abc.com/fold1?ThemeId=8904

https://www.abc.com/fold1?ThemeId=8905

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:

https://www.abc.com/fold1?ThemeId=8904

https://www.abc.com/fold1?ThemeId=8905

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

Once you exclude the query parameter ‘ThemeId’:

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

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 which 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 Google Drive account https://www.google.com/drive/ 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):

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

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

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’:

Step-10: Copy your 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:

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

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

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

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

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

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

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

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

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:

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

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:

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 optimizesmart.com, you would see ‘s’ (search query parameter) followed by your query:

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

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’:

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

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’:

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

Other Articles on Specialised Tracking in Google Analytics

  1. Google Analytics Recurring Revenue and Subscriptions Tracking Guide
  2. How to track the impact of cookie consent on website traffic in Google Analytics
  3. Phone Call Tracking in Google Analytics and Beyond
  4. Scroll Tracking via Scroll Depth Trigger in Google Tag Manager
  5. Video Tracking via YouTube Video Trigger In Google Tag Manager
  6. Calculated Metrics in Google Analytics – Complete Guide
  7. The one thing that you don’t know about PayPal.com and the referral exclusion list
  8. Introduction to Postbacks in Google Analytics
  9. Creating Content Group in Google Analytics via tracking code using gtag.js
  10. Tracking Site Search without Query Parameter in Google Tag Manager
  11. Setting Up Site Search Tracking for POST based search engines in Google Analytics
  12. Tracking Site Search for GET-Based Search Engines in Google Analytics
  13. Understanding site search tracking in Google Analytics
  14. Tracking Virtual Pageviews in Google Tag Manager – Complete Guide
  15. Creating and using Site Search Funnel in Google Analytics
  16. Learn to Setup Facebook Pixel Tracking via Google Tag Manager
  17. How to use Keyword Hero to reveal Not Provided keywords in Google Analytics
  18. Guide to Event Tracking via Google Tag Manager
  19. Learn to track Qualified and Won leads in Google Analytics
  20. Creating your own Google Analytics Tag Auditing System
  21. Using multiple Google Analytics tracking codes on web pages
  22. Guide to Offline Conversion Tracking in Google Analytics
  23. Google Analytics and YouTube Integration Guide
  24. Complete Guide to Google Analytics for Facebook
  25. Tracking true referrals in Google Analytics when using PayPal and other payment gateways
  26. Virtual pageviews in Google Analytics – Complete Guide
  27. YouTube Video tracking via Google Tag Manager
  28. Implementing E-Commerce Tracking via Google Tag Manager
  29. Event Tracking in Google Analytics – Complete Guide
  30. E-Commerce Tracking in Google Analytics – Complete Guide
  31. Google Analytics Cross Domain Tracking Explained Like Never Before
  32. Google Analytics Social Tracking – Twitter, Facebook, Google Plus and LinkedIn
  33. Setting up & Tracking AMP Pages in Google Analytics
  34. Setting up Sales Funnel across websites in Google Analytics
  35. Using Data Visualization to analyze the SEO Performance
  36. Tracking offline conversions in Google Adwords
  37. How to Correctly Measure Conversion Date & Time in Google Analytics
  38. Tracking Twitter and Linkedin Social Interactions in Google Analytics
  39. Implementing Scroll Tracking via Google Tag Manager
  40. Phone Call Tracking and ROI calculations – Champion’s Guide
  41. Google Analytics Cross Domain Tracking (ga.js)
  42. Open Graph Protocol for Facebook Explained with Examples
  43. How to Exclude URL Query Parameters in Google Analytics?
  44. Understanding Google Analytics Default Page Setting
  45. Implementing rollup reporting in Google Analytics

Most Popular E-Books from OptimizeSmart

Learn to read e-commerce reports book banner

How to learn and master Web Analytics and Google Analytics?

Take the Course

Check out my best selling books on Web Analytics and Conversion Optimization on Amazon

How to get lot more useful information?

I share lot more useful information on Web Analytics and Google Analytics on LinkedIn then I can via any other medium. So there is really an incentive for you, to follow me there.

Himanshu Sharma

Certified web analyst and founder of OptimizeSmart.com

My name is Himanshu Sharma and I help businesses find and fix their Google Analytics and conversion issues. If you have any questions or comments please contact me.

  • Over twelve years' experience in SEO, PPC and web analytics
  • Google Analytics certified
  • Google AdWords certified
  • Nominated for Digital Analytics Association Award for Excellence
  • Bachelors degree in Internet Science
  • Founder of OptimizeSmart.com and EventEducation.com

I am also the author of four books:

error: Alert: Content is protected !!