All Collections
Data Transformation
Metrics
Why can I not calculate CPC in a rule?
Why can I not calculate CPC in a rule?
Peter Lundberg avatar
Written by Peter Lundberg
Updated over a week ago

For example a Cost divided by Clicks calculation can be done using either formula or rule based metrics but gives very different results. Only formula metrics will calculate ratios correctly. Consider for a moment the following table:

In the summary row we can see that the totals for the Metrics Cost and Clicks are the sum of the respective value for each day. What would happen if we would also sum the values in the CPC column? That would give us a total of 27.25. As we can easily see by looking at the data our average CPC for the date in the table should be somewhere in the bounds of our minimum and maximum value, i.e. between 4 and 6.25. Clearly 27.25 is way above that! In order to get the correct value we need to apply the Cost / Clicks calculation to the summary row as well, which will give us the correct value, 505 / 93 = 5.43.
โ€‹
A simple rule of thumbs is "Will I need to do any divisions? - then I should be creating a Formula Metric".

Did this answer your question?