Knowledge |

Extracting Query Parameters in Google Analytics – Free Tool

Auditing your Google Analytics account for query parameters can be tedious but helps keep page reports clear of unwanted row duplication. We talk about the effects of collecting unwanted queries on your reporting and how to fix it. We’ve also built a free tool to make the process easier.

What are URL Query Parameters?

URL query parameters are extra pieces of information which can be appended onto the end of URLs. They are used for lots of different purposes including site functionality, cookies, analytical functions and other purposes.

By default, Google Analytics only filters out a few specific query parameters. The most common ones being:

Parameter NameUsage
_gaUsed to manage cross domain tracking
utm_source, utm_medium, utm_campaign, utm_content and utm_termUsed to track campaign and source information

Example URL with Query Parameters
https://www.3whitehats.com/?utm_source=google&utm_medium=cpc&utm_campaign=mycampaign

Aside from the non-exhaustive list of examples above, Google Analytics will record the other parameters as part of your URLs in reports – creating thousands of unique, messy looking pages. Take a look at this report snippet below for our homepage:

PagePageviewsUnique Pageviews
/?fbclid=IwAR00xTb78HCFiXrn6Qc2AnoCbZZsAA7gUEb5yERhyOSTjceha6YHD2Xn5fo11
/?fbclid=IwAR01YubCusHpfulhKfQA4s440PRtKE8pmc2VtAIOXGEDHRtM0RsMa2ssDkA11
/?fbclid=IwAR029Fc9kiLGUMMjhWuGybmXQaXnPAt0Nu4FjaO6ndInVMh2j5_9F-vc-GA11
/?fbclid=IwAR02m25f-aHk78MqQ8k4BBqLIuWRmTyxz-tyZmNxIs3PH8a4xfDEnS2uSuY11
/?fbclid=IwAR02tWlTu4YynhCLFBwYykTEc2OmA-TfddcnEfJ-rytFTw4Yty-5xIe_6DE11
/?fbclid=IwAR06SsW5MeOqRZkzkdqBxDSm7E_8NmnLBM1e7su6JRyG_4kVnG5n5q2Jrmo11
/?fbclid=IwAR0Bi38cN6sARbonG4jOZKtWQeGW334ZXgBPahol48MY0XoknYWHgrqZW4Y11

This particular set of data is traffic from Facebook to our homepage and, as you can see, this has now caused row duplication which makes it hard when reporting on a single page. This increases row cardinality; something you may encounter if you have a lot of query parameter page duplication. If you hit 1 million rows during a report query, Google Analytics won’t load any more data into your report and will let you know this is happening. Ideally, we want to avoid this if we can.

So what can we do about it? Exclude them! The typical way to do this is find the worst offending parameters and then add them to the query exclusion field in your Analytics Views. This can be tedious if you have lots of query parameters and can take a long time to fully filter out all the unnecessary ones over time.

To help with this arduous task, we’ve built a tool which does all the hard work for you.

Our Google Sheets script allows you to pull in the data from any GA View you have permissions to access to then analyse it for query parameters.

Using the Extractor

Usage Instructions

  1. Make a copy our of tool found here: GA Query Parameter Extractor
  2. Add your GA Property View ID highlighted in yellow
  3. Make sure you have the Google Analytics Add-on For sheets
  4. Click Add-ons > Google Analytics > Run Reports
  5. Once your report has run successfully, click the “Analyse” button below to extract all unique queries from your pageview data
  6. This will now show you all queries found within the data set and also a breakdown of which ones are the worst offenders.

Considerations

This tool is designed to speed up the initial process of identifying those query parameters.

We highly recommend combing through the extracted list of query parameters before adding it to a view exclusion list. Some parameters may change the content of a page and should remain in your All Pages report. If you’re ever unsure, try finding examples within your All Pages report and run them for yourself to make sure they’re not adjusting site content first.

This tool only finds parameters on data you’ve loaded. What we mean by that is if you’re only loading in 1 month’s worth of GA data, you might not be seeing some parameters if they aren’t in that data set.

FAQ

  • I get asked to authorize an App  when I click “Analyse”
      • We’ve written a script behind the scenes which requires edit access of the sheet you’re in. As a precaution, Google always asks users for permission to run scripts which impact the Sheet you’re working on. You can see the code for yourself by heading into Tools > Scripts
      • The sheet and script is fully self-enclosed meaning that data isn’t stored elsewhere nor do we see what the data looks like. It’s run locally to you.
  • When I click I “Analyse” nothing happens
    • Did you first run the report to fetch your GA Data? See step 4 in the Usage Instructions