Build an approval rate
Suppose your report contains 40 submitted leads in Event 1 and 12 approved leads in Event 2. The approval rate is12 / 40 × 100 = 30%.
- Open the report’s metrics selector.
- Find Custom metrics and click Add custom metric.
- Enter
approval_rateas Identifier. - Enter this Formula:
- Choose Percent and click Add metric.
- Display Event 1 and Event 2 alongside the new column.
- Check that the example row displays 30%.
ifnull fallback returns zero when division produces a non-finite value, such as a zero denominator. This keeps the display usable, but zero submissions still means there is no approval-rate evidence.
Only use this formula when Event 1 and Event 2 have those meanings in the campaign being analyzed. Combining campaigns with different event mappings can create a mathematically valid but misleading percentage.
Choose the right display type
Custom Percent formatting does not multiply by 100. Include
* 100 when the formula divides one count by another. For example, event2 / event1 returns 0.3, which would display as 0.3%, not 30%.
Built-in rates use fractional API values, so a custom formula displaying built-in CV as a percentage would use cv * 100.
Use metric keys and supported arithmetic
Formulas use the case-sensitive keys from the metric dictionary, such asvisits, lpclicks, uniqueVisits, revenue, cost, and event2. A UI label such as Clicks is not the formula key lpclicks.
Use a clear identifier beginning with a letter or underscore and containing letters, numbers, or underscores. Choose a name that does not collide with an existing metric or a function. Adding the same custom identifier again replaces its definition.
Supported syntax includes numbers, parentheses, unary plus or minus, and the operators +, -, *, /, and %. Here % means remainder, not percentage formatting.
Supported functions are abs, ceil, floor, max, min, pow, round, sqrt, and ifnull. Use pow(x, 2) for a square. JavaScript property calls such as Math.round(...), comparisons, and conditional expressions are not supported.
Validate with a row you can calculate yourself
For 1,000 visits, USD 300 revenue, and USD 100 cost:value1 of 12, ifnull(value1 / event1, 0) should return three units per order event.
Check both a normal row and a row with a zero denominator. Invalid formulas and non-finite results can display as zero, so a column of zeros is not proof that the formula is correct. Confirm metric spelling, supported syntax, and the underlying input columns.