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|
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.
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!