Digital Intelligence
4 min

Digital Intelligence: Query Parameter Exclusions

Remi Silva

Collecting data in Google Analytics is always exciting, but making sure the data is clean and actionable is even better. A dimension in Google Analytics that is always looked at is the page URL (or request URI), but this data can start looking a little messy when query parameters are captured. Before we get into why the page URL data gets messy, let’s talk about what exactly query parameters are.

A query parameter is a string you append to the end of a URL. These can be appended onto URLs to help define where the traffic came from and/or the audience (e.g. www.example.com/?utm_source=google&utm_medium=organic), or they can be used to define specific actions on your site, such as toggling between different colors of a product on a product list page.

These are all great uses of query parameters, but when you start pulling page-based reports in Google Analytics, the data becomes so fragmented that it is no longer useful for finding insights. Looking at metrics of a product category page that contains filters becomes tedious, as we’d have to pull all variations of that specific product category page and then aggregate the numbers. For example, if you’re asked to pull metrics for the pants category page (/pants/), this is what you would see in Google Analytics if that URL had query parameters:

Page Pageviews Unique Pageviews Avg. Time on Page Entrances Bounce Rate % Exit Page Value
/pants/ 399 291 0:00:37 17 17.65% 6.27% $0.00
/pants/?color=blue&size=small 306 229 0:01:47 92 58.70% 53.92% $0.00
/pants/?color=blue&size=large 301 206 0:00:31 13 23.08% 14.62% $0.00
/pants/?color=blue&size=medium 74 48 0:00:40 1 100.00% 17.57% $0.00
/pants/?color=red&size=small 53 32 0:00:38 0 0.00% 7.55% $0.00
/pants/?color=red&size=large 25 20 0:00:12 0 0.00% 12.00% $0.00
/pants/?color=red&size=medium 23 22 0:00:24 0 0.00% 8.70% $0.00
/pants/?color=blue 3 3 0:00:06 0 0.00% 0.00% $0.00
/pants/?color=red 2 1 0:00:12 0 0.00% 50.00% $0.00

Although all of these page views were on the /pants/ page, Google Analytics parses the pages as if they’re all technically on different URLs. This is great if you’re looking for metrics for very specific pages, such as /pants/?color=red&size=medium, but I would argue that having the data all aggregated under /pants/ is more actionable. If you’re looking for metrics around behavior on a page, such as interacting with specific filters, I would recommend tracking that through events and utilizing advanced segments.

Now that we’ve covered query parameters and why they make data messy, let’s go over how we can exclude them from the Pages report. In order to exclude query parameters, go to the Admin Panel in Google Analytics, and then click on “View Settings” on the top right-hand corner. After, you’ll see a field called “Exclude URL Query Parameters” where you’ll need to enter all of the query parameters you’ll want to exclude.

Screenshot from the Google Analytics Demo Account

Here are a few interesting notes about the “Exclude URL Query Parameter” function:

  • It is case sensitive.
  • It applies before Filters.
    • This is important to note, because if you have a filter that force lowercases URIs and you’re filtering out a lowercased version of the query parameter, and assuming that the query parameter is proper case, then the Exclude URL Query Parameter will not work (i.e. filtering out product_category will not work if the query parameter is Product_Category).
  • It must be separated by commas.
  • It does not require a space between the commas.
  • You can use query parameters to exclude PII from being shown in Google Analytics, but this is still against Google’s TOS as the PII is still being processed by Google Analytics. Also, if you go this route with handling PII, then make sure to use this method for all of the views.

Overall, query parameters are essential for websites, but they can make the data messier if they are not managed properly. In order to prevent the query parameters from making your data fragmented, make sure to exclude query parameters that are not thoroughly being analyzed. If you want to be able to analyze all query parameter data, either create a separate view or use an unfiltered view.

If you’re having query parameter issues, reach out to the Digital Intelligence team at Wpromote!

Digital Intelligence Google Analytics
Exit mobile version