Transforming Google Data Studio Reports: Cleaning Up URLs

One of the most difficult parts of creating digital marketing reports is effectively and efficiently communicating the results of your online efforts. To help you create more intuitive Google Data Studio reports, I have compiled three great suggestions for you to use. Since these posts are written in a longer “how-to” format, I have spliced them up into three different blogs, making them more digestible. This suggestion is all about making your URLs easier to read and understand.

When URLs Aren’t Intuitive In Your Reports

In a perfect world, your URLs never change and they match your page title to a tee. Unfortunately, this perfect world is far, far away for many analytics practitioners. Furthermore, even when your URL meets both of these conditions, it can be hard to read for people who are not knee-deep in Google Analytics data every day. Below are common cases when you might need to give your URL a different name to make it easier to comprehend for report recipients:

  1. Your Homepage: Often your homepage URL is a simple forward slash. When not accompanied by the rest of your domain, it is less intuitive that the symbol “/” is the front page of your website. Make it easier for your reader by changing the name in your reports to “Homepage.”
  2. Your Location Pages: For multi-location businesses, interpreting URLs is not always impossible, rather it is just inconvenient. Try changing the page path “/locations/dallas-main-street” to “Dallas – Main Street Location.” Even better, stick to standard naming conventions used throughout the organization. For example, if the Dallas Main Street location is referred to as Store # 152, use that nomenclature in your reporting.
  3. Grouping Pages: Sometimes landing pages are more user-friendly without grouping them under a subfolder. For example, you may want to use the URL “example.com/50-percent-off” on your Google Ads campaigns instead of “example.com/landing-page/50-percent-off” to get a higher click-through rate. While this is a smart move by your PPC team, remembering all your landing page URLs when looking at a report can be a pain. Try adding a prefix in your reporting to add more clarity, such as “PPC Landing Page: 50% Off.”

How To Rename URLs In Data Studio

After you have added your data source (in this case, Google Analytics) into Google Data Studio, go to Resource > Manage Added Data Sources.

Click “Edit” once your data source appears.

Name your Field Name – I chose the name “Modified URL.” Then you will use a Case/When formula to categorize your URLs.

In the screenshot, I have given two types of REGEXP_MATCH formulas to produce our desired end result. The first one is

WHEN REGEXP_MATCH(Landing Page, "^/$") THEN "Homepage"

This formula will change the page path “/” to the word “Homepage.” If you are not familiar with regex and haven’t read my regex 101 post, the formula may seem like a foreign language. Translated, the formula says “Whenever you see a landing page that exactly matches ‘/’, make it say “Homepage” instead.

This formula will only work for those who have not prepended the hostname to the URL in Google Analytics. If you have prepended your hostname, make sure to add it in right after the caret.

The second formula is much more simple:

WHEN REGEXP_MATCH(Landing Page, '.*(/locations/dallas-main-street/).*') THEN "Dallas - Main Street"

Translated, this says “Whenever you see the URL ‘/locations/dallas-main-street/’, use ‘Dallas – Main Street’ instead. When you use this formula on your own data, replace my fake URL with the URL you want to use. Even though this formula uses regular expressions, you will notice there is no need for you to escape characters such as dashes or forward slashes in either one of these examples.

Note: If you have a question mark in your URL, you won’t be able to simply escape the character with a slash (\). To make this work, I’ve found you’ll need to instead put your question mark with brackets around it. For example, if my URL was /locations?dallas-main-street/ I would instead write /locations[?]dallas-main-street/

Lastly, make sure when you are transforming URLs that you end your formula with ELSE Landing Page, otherwise, URLs that do not fit into the specific cases you defined will not show up at all, leading to a lot of missing data.

Once you have finished writing your formulas, click Update and then Done!

Summary

The easier you make it for people to read your reports, the quicker and more likely they are to understand your key takeaways. Transform your URLs so that they can be comprehended quicker by those outside of the digital marketing world. For other ways to make your Data Studio reports more intuitive, read my other two blogs about changing your metric and dimension names and employing conditional formatting.