Data Studio - How To Group Content Where Pattern Equals 'Page Starts With' Using CASE + REGEX_MATCH

Data Studio - How To Group Content Where Pattern Equals 'Page Starts With' Using CASE + REGEX_MATCH

Let’s say you want to group content [page paths] based on the opening text pattern. Example:

IF page path starts with /news, THEN output should be “News”

IF page path starts with /blog/news THEN output should be “Blog”

Else “Other”

You can use REGEX_MATCH to find text pattern and combine it with CASE (IF THIS THEN THAT).

In Regex, you can use the caret (^) symbol to instruct regex that the variable value should start with X. The extra chars in the below markdown take care of casing in the text, so you don’t have to worry about it.

and now, let’s just test this in Data Studio.

Yep, works!

Yep, works!

Exploratory Data Analysis: DataExplorer R package for quick EDA

Exploratory Data Analysis: DataExplorer R package for quick EDA

E-commerce Product Recommendations: Apriori algorithm - Market Basket Analysis Interactive Lift Visualization & More Via R + Shiny

E-commerce Product Recommendations: Apriori algorithm - Market Basket Analysis Interactive Lift Visualization & More Via R + Shiny