Data Studio
3K members online now
3K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

Can I do a ratio between two Analytics Event Actions in Formulas?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi community! 

I'm trying to have a ratio between two Analytics Event Actions. Is there a way to do that ?

 

I dumbly tried like this but obviously there's no simple way to specify which Event Actions should be divided...

Capture.PNG

Thanks fo your help!

Louis

1 Expert replyverified_user

Can I do a ratio between two Analytics Event Actions in Formulas?

Google Employee
# 2
Google Employee

Hi Louis

 

That was an understandable first try!

 

You might try something like this: create a new calculated field ("Event 1 count"):

SUM(CASE WHEN Event Action = "Add to Cart" THEN 1 ELSE 0 END)

 

Then create a second field ("Event 2 count"):

SUM(CASE WHEN Event Action = "Checkout" THEN 1 ELSE 0 END)

 

(Obviously, you'd use your own field names and events here)

 

Now you can calculate a ratio doing Event 1 count / Event 2 count, etc

 

Hope this helps!

 

Rick

Can I do a ratio between two Analytics Event Actions in Formulas?

Follower ✭ ✭ ☆
# 3
Follower ✭ ✭ ☆

 

Hi Rick/ Louis, 

 

Unfortunately this formula does not work - assuming there are events that match the criteria, it reports back an answer of '1' instead of the sum of events. 

There are a few other threads on this topic, but I have not yet seen a way to sum GA events. 

 

Other threads:

https://www.en.advertisercommunity.com/t5/Data-Studio/Creating-a-Filter-as-a-Calculated-Metric-Googl...

https://www.en.advertisercommunity.com/t5/Data-Studio/Count-of-GA-Events-as-a-calculated-field-in-Da...

 

The way I have gotten around this is to add event based goals into GA, and then reference those. Works ok if you just have a few events you want to reference, and you don't need historical data. 

 

Brendan