Analytics
2.5K members online now
2.5K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Calculated Metrics - Is it possible to add If condition ?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

I am currently using this formula, in Caculated Metrics, to compute CPA:

{{Cost}} / {{Transactions}}

 

However this formula is not correct when Transactions = 0. The formula will give me an error.

I would like to put an IF condition in order to be able to compute the CPA for this case.

 

I would like to have something like this:

IF Transaction>0 

then Cost/Transaction

else Cost

 

 

Thanks in advance for your help!

1 Expert replyverified_user

Calculated Metrics - Is it possible to add If condition ?

Rising Star
# 2
Rising Star

Hey Ricardo,

 

You can create your own custom metric and then only pass a value to it conditionally.   Then use this in your calculated metric.

 

Best,

 

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Calculated Metrics - Is it possible to add If condition ?

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Theo,

 

Sorry but I did not understand your solution.

I do know how to create the custom metric but I do not know how to do this part here "... then only pass a value to it conditionally...".


Could you guide me on how to do that part?

 

Best regards,

Ricardo

Re: Calculated Metrics - Is it possible to add If condition ?

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭

Hi Theo.

 

Still on Ricardo's issue, is your solution able to google analytics or only for google 360? I am afraid we (I work with Ricardo) have limited tools since we don't have suite 360.

 

ty

Bruno