How to exclude query parameters from URLs using Google Analytics spreadsheet

by Lakeer Kukadia

Did you ever looked at your Google analytics content report and found a confusing result displaying different page views reports for the same page? And then you have to sit and carry out a tedious job of filtering each result to get an actual total value.  

But why did this happen?

Well, the reason for this confusion is “Query Parameters”

Query Parameters

‘Query parameters’ can transform an ordinary URL into a never-ending string of characters. Each website is built on parameters and each parameter has a purpose. These parameters are added to a URL when a visitor navigates deeply through a website, land on a page or come to the site through a specific digital marketing campaign.

If you have ever tried Google analytics content report, you must have realized how difficult it gets to navigate these URLs. The number of pages can multiply with just the addition of a few parameters, making it difficult to navigate. 

Example of Query String

As you can see the URL is difficult to read and decipher, also changing any one single parameter from the URL may signal Google analytics to treat it as a different page altogether.

The above screenshot is an example of how a single page ‘myaccount.html’ is reported differently using a different URL each time. So you need to analyze every URL in order to get the real value. It doesn’t seem like a daunting task for the current website with just a few different URL’s, but websites with thousands and millions of page visitors cannot afford to invest time and efforts to filter each URL to get the actual value.

Problems with Query Parameters

  • Query Parameters fragments data

Query Parameters break up URLs into Google’s web analytics report. The same webpage may be divided into tens, hundreds or even thousands of different pages when a few combinations of parameter are altered. This can make analysis difficult and in some cases impossible.

  • Query parameters can lead to cardinality

As we already know, query parameters can multiply the number of pages in your web analytics report. But if you have a high number of visitors and the number of rows exceeds 50,000 everyday, Google automatically categorizes the analytics of this webpage as ‘others’. Because Google has a set limit of value a dimension can have. So, thousands of pages of a website may get categorized as “other” making the data inaccessible to analyze. 

  • Personal Identification Information can be found in these parameters

If you ever prompt your visitors to enter personal information like name, phone number, address, email ID etc., you should be careful not to send this kind of personal information through Google servers. Query parameters can include this information in the URL and transfer it through Google servers. This is strictly against Google’s privacy policies and may result in the wrongful termination of your web analytics account. In order to avoid this, you need to eliminate these parameters at the view & data collection level through GTM in Google analytics.  

Using GA (Google Analytics) spreadsheet to identify and exclude query parameters

As mentioned before, all websites are built using specific parameters and each parameter has its own unique value. Hence, you must first identify all the parameters lurking into your URL. You can do this manually, but with more pages you have in the content report, it gets difficult and becomes a time-consuming process.

Fortunately, in order to tackle these problems, Google created its own spreadsheet. Once you make a copy of this sheet and follow the instruction written below, you will be left with all the query parameters of past ‘N’ number of days. While using this sheet it is advisable to use a view without any filter on it.

Steps to identify query parameters:

  • Open Google spreadsheet  
  • Make a copy of this template, click on ‘File’ and ‘make a copy…’
  • Get the Google Analytics add-on, select ‘Add-on’ from the head menu, Click on Get add-on feature, a window will pop-up, search for Google Analytics and install
  • Open your Google analytics account, to your desired view and look; in the URL you will see something like “/a54516992w87479473p92320289/” at the end. The portion after ‘p’ is your View Id   “/a54516992w87479473p92320289/”
  • In the report configuration sheet, enter your View Id (highlighted in yellow)
  • Optionally, modify the ‘Last N Days’ option as per your requirement.

From the add-ons select Google analytics >> Run reports (Click ok, if you see the upgrade) & wait for it to finish.

The Query parameters will appear in the ‘ Unique Query Parameter’ sheet, mark yes to all those parameters you want to exclude and the excluded parameters will automatically appear in the yellow box for you to copy.

Go to your Google analytics account, Admin >> view settings and paste it into the “Exclude URL Query Parameter” field.

How to Treat your Site Search Query Parameters?

If you have a site search option within your website, it is likely that the query parameters in your content report also include the site search information to distinguish specific searches by the user. Although it is important to have site search information into your GA account, leaving this information in the URL could make your job tedious.

In order to keep the search site information in your content report, but exclude the information from query parameters, switch on the Site search Tracking, enter the query parameters you want to exclude (you could strip up to maximum 5 parameters)  and check the box saying ‘ Strip query parameter out of URL’. If your website has products divided by categories, you can follow the same procedure for Site Search Categories

Do not switch off the Site search tracking; doing so will eliminate all site search data.

If you are still unsure about how this works or what query parameters to exclude, just copy the official view, follow all the above steps and test the results yourself. The steps to do more cohesive and error-free analysis are as simple as that.

Related Posts

Leave a Comment