Skip to main content
Use custom metrics for formulas such as approval rate or profit per visit. For example, if Event 1 is a submitted lead and Event 2 is an approved lead, divide Event 2 by Event 1 to calculate approval rate. Custom formulas use the metrics in each report row. The totals row applies your formula to the total counts and amounts.

Build an approval rate

Suppose your report contains 40 submitted leads in Event 1 and 12 approved leads in Event 2. The approval rate is 12 / 40 × 100 = 30%.
  1. Open the report’s metrics selector.
  2. Find Custom metrics and click Add custom metric.
  3. Enter approval_rate as Identifier.
  4. Enter this Formula:
  1. Choose Percent and click Add metric.
  2. Display Event 1 and Event 2 alongside the new column.
  3. Check that the example row displays 30%.
Here, ifnull displays zero when there are no submissions to divide by. Use this formula only for campaigns where Event 1 means a submitted lead and Event 2 means an approved lead.

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%. For a custom formula using a built-in rate, multiply that rate by 100. For example, use cv * 100 to display CV as a percentage.

Use metric keys and supported arithmetic

Formulas use the case-sensitive keys from the metric dictionary, such as visits, 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 and round(x) to round a number.

Validate with a row you can calculate yourself

Display the formula’s input columns beside the custom metric. Check one row by hand. If the result differs, check the formula’s metric keys and display type.

Reuse a formula

Custom metrics are saved only in the current browser. They are not shared with teammates or available through the public reports API. Keep a copy of formulas you need elsewhere. Sorting a custom metric orders only the loaded rows. For a complete ranking, retrieve the full report dataset, calculate the formula, and sort the results. Use the remove control in the metrics selector when a formula is no longer needed.