Home » Removing URL parameters in Looker Studio

Removing URL parameters in Looker Studio

by Luuk

URL parameters are extra pieces of information added to the end of a web address (URL) that help tell a website how to behave or what content to show. They usually come after a question mark (?) in the URL and are made up of key-value pairs separated by an ampersand (&).

For example, in the URL https://example.com/page?category=shoes&color=blue, category and color are parameters, and shoes and blue are their corresponding values.

Why remove URL parameters in reports?

  • Keep Things Safe: Just like you wouldn’t want to share personal info online, those extra bits might accidentally include stuff you don’t want others to see, like your username or other private details.
  • Make Sure You See the Right Stuff: Sometimes those extra bits can mess up what the report shows, like changing the filters or settings. Removing them means everyone sees the same stuff you do.
  • Keep It Simple: Have you ever seen a really long and confusing web link? Those extra bits can make the link super long and hard to understand. Removing them makes the link shorter and easier to share.
  • Make It Fast: Too many extra bits can slow down how quickly the report loads. By getting rid of them, the report loads faster and you don’t have to wait as long to see the cool stuff.

An example of what removing parameters can do is shown below. We removed the fbclid parameter from Facebook. Now the results of both landing pages are summed up.

Removing URL parameters in Looker Studio

When removing URL parameters, the results will be merged

Using the Regexp_replace functionality

In the above case we used the REGEXP_Replace functionality to remove the parameter from the URL. Let’s breakdown the formula, to make it understandable.

  • REGEXP_REPLACE: with this functionality you can change parts of a text based on specific rules.
  • (Landing page, ‘[?].*’, ”): this is how we used the tool, we gave it three pieces of information:
    • Landing page: the dimension we changed.
    • ‘[?].*’: This is the rule we applied. It’s like saying, “Find anything that starts with a question mark (?) and then has anything after it.”
    • : This is what you want to replace the found text with. Here, it’s empty, so it means you want to delete whatever matches the rule.

So, when you use this formula, it finds any part of a landing page that starts with a question mark (usually where website parameters start, like “?utm_source=google”) and removes it. For example, if you have a landing page like “example.com/page?utm_source=google&utm_medium=cpc”, it’ll change it to “example.com/page”.

Use REGEXP_REPLACE to remove URL parameters

Changing the field type to create a hyperlink

A last tip to make the table complete. Change the type of the field from “text” to “URL:”. This way you can make the new made URL’s clickable. Very convenient to go directly to the relevant landing page.

Don’t forget to change the field type to “URL:”

You may also like