Gain Better Landing Page Insights by Cleaning Up Query Parameters

Determining user behavior from aggregate data to your website is critical for making informed decisions.  A popular and useful report to examine when determining how marketing strategies are performing, is a landing page report.  This report allows you to gauge the performance of the first page of your website a user engages with. There are times when getting a clear picture of how a singular landing page is performing is obfuscated by the use of certain query parameters.  Google Analytics treats every unique website URL as an individual Page.  However, every unique URL is not necessarily a unique page in terms of content.  The content of the page may stay the same even though the URL changes.  Let’s take a closer look at query parameters.

What are Query Parameters? 

Wikipedia defines a query parameter, also called a “query string”, as follows: “A query string is a part of a uniform resource locator (URL) that assigns values to specified parameters. A query string commonly includes fields added to a base URL by a Web browser or other client application, for example as part of an HTML, choosing the appearance of a page, or jumping to positions in multimedia content.” A query string can have one parameter or many joined together with a separator.

SEMRush has a great article on a beginners guide to query parameters that is worth the time to read if you want a clear understanding

Google Analytics Query Parameters

Issues with Unique Parameter Values

Where query strings become an issue with web analytics platforms like Google Analytics, is when those platforms treat each unique URL as a unique page on a website regardless of the content on the page.  There are times when the parameters attached to a URL can, in fact, change the content of the page thereby making it unique to the user, but there are also times when these parameters are used for other purposes, such as tracking marketing sources or session IDs, that can cause issues when trying to analyze a truly unique web page in aggregate.  

In the table above you can see that even though the users are being shown the exact same content (the page /example-landing-page/), Google Analytics has 5 separate cases with different query parameters.  This makes it difficult to determine the true performance of the content because all the data is spread over several instances.

The Trailing Slash Issue

Another issue, that you can see in the table above that is not directly related to query parameters, is the existence of URLs that have trailing slashes and those without trailing slashes.  While the content on the page of those two URLs is identical, the URLs are different and Google Analytics will treat them as such. It is always a good practice to make sure your URLs redirect to a URL containing either a trailing slash or no trailing slash (using a 301 redirect!).  Otherwise you can run into an issue where page metrics get split between two identical pages.

Database Limitations 

An additional issue to consider when running a larger site with many pages and query parameters are limits on how much data can be presented in reports.  For Universal Google Analytics there is a daily limit of 50,000 rows in any table.  Once you reach that limit, only the top 50,000 will be listed with the rest reported in one aggregated line of  “Other”. Removing the unneeded query parameters will help reduce the total number of rows present and avoid the aggregation of excessive rows.  You can read more about data limits for Universal Analytics properties here.

How to Resolve These Issues 

To resolve these issues it is important to follow three steps:

  1. Have multiple views
    1. It is always a good idea to have one Google Analytics view that is unfiltered and not used for reporting.  There may be times when you need to refer back to the raw data.  For instance, to check query parameters you are ignoring or the impact of filters you may have added..
    2. You can view the steps for adding a new view in Google Analytics here. In this view, you do not add any filters, exclude any parameters or set up goals.
  2. Determine parameters you would like to exclude
    1. You will want to avoid excluding query parameters that change any content on a web page and focus on query parameters that have no effect on how a web page is rendered.
    2. You can do this either manually, if there are a small number of parameters you would like to exclude, or you can use this handy worksheet that is provided by Google Analytics for determining which parameters you might want to exclude. We used to achieve the same results using an Excel spreadsheet in the past.
  3. Filter the parameters
    1. After determining which parameters to exclude, you can then filter them from any new traffic that the site receives. (Note that the filters do not remove any query parameters from existing data.)
      1. On the main screen of Google Analytics click on the “Admin” gear on the lower left side on the navigation bar.
      2. Click on the “View Settings” link under the view you would like to add the exclusions.
      3. Add query parameters to be filtered to the text box “Exclude URL Query Parameters” separating each with a comma.
      4. Click “Save”

At this point you have added the query parameters to be excluded from the reports so that any new data being collected will now have those parameters’ keys and values stripped from the URL  For example, take the URL https://www.example.com/?page=1&fake_id=123456789. If you set fake_id to be ignored, the URL would now become https://www.example.com/?page=1. It is important to keep an eye on new data coming in to make sure what you want filtered is actually being filtered and that there is no unexpected behavior. (Exclusion of needed URLs, for example.)  It is also important to plan ahead if you have the opportunity, so if you know you are going to start using a new parameter, determine whether you should add it to the ignore list.

At this time, the ability to exclude query parameters is only available in the Universal Analytics version of Google Analytics, not Google Analytics 4.It is likely a similar feature will be added in the future.