AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Data Studio
3.6K members online now
3.6K members online now
Ask questions about Data Studio
Guide Me

Calculated Metrics Regex Help

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi All,


Regex noob here...


I'm having some trouble building some formulas to calculate some conversion metrics using Event Action, Event Label, and Page dimensions.  I've found a few examples here on the forums but can't seem to modify them to fit my needs.


I'm trying to calculate the following.


Unique Events (when Event Action contains 'term1' and Event Label contains 'term2')




Sessions (where page contains 'term3')



This would ultimately give me the conversion rate for a product.



I started with this to try and get the numerator to see if it matches my regular count.  


Unique Events * MAX(CASE WHEN ( REGEXP_MATCH(Event Action, '.abc.') AND REGEXP_MATCH(Event Label, '.abc.*') ) THEN 1 ELSE 0 END )......