Sometimes our instant and custom metrics don’t provide the type of information you’re looking for. When this happens, try creating a calculated metric instead.
Here’s a simple calculated metric example: You have two "Revenue" metrics, one for each of your product lines. Add these two metrics together using the formula
Product A Revenue + Product B Revenue to create a single calculated metric that displays the "Revenue Total" for both products. See this article for more calculated metric examples.
This article contains the following sections:
- What are calculated metrics?
- What do I need to know about calculated metrics?
- Creating a calculated metric
- Editing a calculated metric
- Calculated metrics: Video example
What are calculated metrics?
Calculated metrics combine metric values using an equation (with simple math - addition, subtraction, multiplication, and division) to create a metric that can be expressed as a number, a percentage, or a ratio.
Here are some examples of calculated metric formulas:
- Lifetime Value to Cost Of Acquisition Ratio:
ƒ((Customer Lifetime Value)/(Customer Acquisition Cost))
- True Trials:
ƒ(count(Trial Users that have signed in twice within the first 7 days) / Count(All Trial Users))
What do I need to know about Klipfolio calculated metrics?
Here are a few things to note about calculated metrics:
- When creating a calculated metric, dimensions are selected for you, based on shared, common dimensions from your referenced metrics.
- The aggregation type for a calculated metric is based on the formula and is not configurable.
- If a referenced metric is deleted or no longer shared with you, any calculated metrics derived from it will not be able to calculate accurately. You will need to modify the calculated metric’s formula to update it.
- Functions in calculated metric formulas are not currently supported.
Creating a calculated metric
As a first step, ensure you have access to the metrics you will reference when creating your calculated metric.
- Giving your referenced metrics relevant, recognizable names will help you when it’s time to enter them into your calculated metric formula.
- After creating a calculated metric, you can use it as a referenced metric for other calculated metrics.
Within the calculated metric configuration wizard, you have the option of moving forward and back, so it’s easy to play with your formula and settings until you get the end result you’re looking for. For additional clarity, as you create your calculated metric, the Preview pane displays the results of your choices. (Note that the metric value in the Preview pane uses the "maximum" date range setting, which is the overlap of time from the referenced metrics.)
During the calculated metric creation process, you:
- Enter a formula: The formula structure enables you to perform calculations by inserting operators, grouping with parentheses, and entering constant numerical values, if applicable, for example: (Revenue - Expenses) *2.14. The following operators are supported: +, -, /, *, and ().
- Apply filters: As you’re entering your formula, you can optionally apply filters to referenced metrics to include or exclude members for each dimension.
- Choose display settings: This is where you give your calculated metric a name and choose how you want it to display. We recommend choosing a relevant, descriptive name, ideally including the typical terminology for the metric you want to create, for example, “Page Views per Session”. In the Display settings window, you can also set a favourable trend, choose a format type (numeric, currency, duration, or percentage), and choose whether or not to show your data cumulatively.
To create a calculated metric:
- In the left navigation sidebar, click the + button beside Metrics.
Note: You can also add a calculated metric from the Metric List page or from an open dashboard, in Edit mode.
- Click Calculate a new metric.
- On the Create a calculated metric page, in the Formula window, write your formula by entering the names of your referenced metrics, separated by the appropriate operator(s) (+, -, /, *) and including parentheses and constant numerical values, as needed. Continue adding formula components as required.
Tip: To see a list of all of your metrics and to quickly select and enter them into your formula, click the + button (as shown below).
You can also copy and paste entire or partial formulas. Note that the right-hand Preview pane updates as you build your formula.
There are limits to the number of metrics and nested metrics allowed in a calculated metric formula. If your formula exceeds the maximum number of metrics, you must reassess your formula to reduce them. If your formula exceeds the maximum number of nested metrics, we will indicate which metric(s) needs to be reconfigured.
- Click on the referenced metric to see its aggregation type. The aggregation type is chosen for you based on the referenced metric’s aggregation type, but you can modify this setting if required.
- If you want to apply filters, click on the referenced metric and, under Filters, select the members to filter for each dimension. Next, select either Include or Exclude, and click Filter.
- When you’re done building your formula, click Next.
- In the Display settings window, under Metric name, type a name for your calculated metric.
You can also name your metric in the Preview pane.
- Under Format, choose a format type from the drop-down menu.
- Optionally, set your data to Show as cumulative.
- Optionally, set a Favourable trend for your calculated metric.
Choose whether you want ascending or descending values to indicate a positive trend. For example, if your metric includes sales totals, a higher (ascending) number demonstrates a positive trend but, if your metric includes cost to acquire customers, a lower (descending) number indicates a positive trend. This option only applies to scorecard (single value) visualizations. Favourable trends are indicated by a green arrow.
- Click Save.
Editing a calculated metric
After creating a calculated metric, you can edit it to modify its formula, name, format type, and other optional settings.
To edit a calculated metric:
- In the left navigation sidebar, click Metrics.
- Choose the calculated metric you want to edit from the Metric List page.
The metric opens in its Explore View.
- Click the 3-dot menu beside the metric’s name and click Edit.
The Edit <name of metric> page opens.
- Modify your calculated metric.
- Click Save.
Calculated metrics: Video example
The following video demonstrates how to use calculated metrics to get the total number of new users from two landing pages (each with its own Google Analytics Profile ID). It also describes how to show the percentage of new users that comes from each landing page.