When you have a website, you often have product category pages or search results pages that include parameters. Something like this:
In this example your user searched for the term “lawn widget” and set the maximum price to 500 $/€/etc.
When you have searches for 2,000 different products, it makes it impossible to use your standard Google Analytics data to cleanly compare use of the page overall — eg, the /product-search page.
Here’s how to get just the clean URL in Google Data Studio.
This is handy because it works for all historical data in Google Analytics, whereas if you set up a filter in a new view, that will only apply to pageviews from there on out.
What you’ll need
- Google Analytics set up on your website
- Access to the Google Analytics account
- Create a Google Data Studio report
Steps to extract the page URL without the query parameters
- Open your Google Data Studio report if you have one, or create a new one and add the correct Google Analytics account as your source data
- In the menu, click “Resource,” then click “Manage Added Data Sources”
- For the GA data source you want, click “Edit”
- Click “Add a Field”
- Name the field “Page URL with parameters removed” (or whatever you prefer)
- Copy and paste this formula into the Formula field.
- If you get an error message, manually delete and re-type the quotation marks in the formula.
- If you still get an error message, re-type with a double backslash in each spot where there is a backslash:
- Click Save.
- Click Done.
You can now create a chart using the new field as a Dimension.
Bonus: To remove the underlining in a chart
- Select the chart
- Click the link icon next to the dimension name
- Change the Type from URL to Text