As a continuation of the article “Google Analytics Metrics and Dimensions”, in this article I will discuss Calculated Metrics that can be applied at the View level, and how we can effectively utilize them in our reports.
You can find support for Google Analytics here.
Google Analytics Calculated Metrics
Calculated Metrics (calculated metrics) are a feature of Universal Analytics (UA) that is available for websites using the gtag.js and analytics.js setup — with no support for the legacy ga.js — and enables users to create new metrics using existing Google Analytics metrics and use them in reports. This allows us to perform more insightful analyses by leveraging user-defined metrics and expand the scope of our reports. Calculated Metrics are currently available to Google Analytics users in beta form as of March 2019.
For example, a calculated metric can be easily used in Google Analytics > Custom Reports, Custom Dashboard Tables, Widgets, and Analytics reporting APIs1. The Analytics reporting API also includes support for Looker Studio usage. To access the API, access to the components within the calculated metric content must also be available via the API.
Creating a Calculated Metric
Calculated metrics are effective at the View level, as mentioned in the introduction section. To create a new calculated metric and/or view existing user-defined metrics, you can follow the path View Settings > Calculated Metrics. To create a calculated metric, we need to fill in the following fields.
- Name
- External Name
- Formatting Type
- Formula
Let’s briefly review what each field represents.
Name
Name represents the user-defined metric (calculated metric) that is created. The provided name enables easy access to the relevant metric from the list of metrics during metric usage.
External Name
External Name is a unique value created in addition to the calcMetric_ designation. The external name definition must not contain any special characters, symbols, or spaces apart from alphanumeric characters and underscores. Once created, external names cannot be edited. External names are used when querying via the API. An example of an external name appears as follows: calcMetric_UniqueExternalName.
Formatting Type
Formatting Type covers the following data types.
- Integer (Integer; decimal places can be customized)
- Currency (Currency; decimal places)
- Time (Time)
- Float (Floating-point)
- Percentage (Percentage; decimal places can be customized)
Formula field enables you to define calculations by using predefined metrics along with supported operators, and these definitions are specified within double curly braces {{Metric Name}}. The metric name may vary depending on the Google Analytics language; for example, {{Total Events}} instead of {{Total Engagement Count}}. To view available metrics, simply click on the Formula field. Supported operators:
- Plus (+)
- Minus (-)
- Divided by (/)
- Multiplied by (*)
- Parentheses (())
- Positive cardinal numbers or numeric values (0-9). Decimal values are allowed.
Negative usage of the minus operator is not supported (i.e., A-B is supported, but -B+A is not). Formulas can contain up to 1024 characters. When creating a new calculated metric, you cannot use any other predefined custom metric. For standard Google Analytics, up to 5 calculated metrics are supported at the view level, and for Google Analytics 360, up to 50 calculated metrics are supported.
Formula field allows you to quickly create and modify formulas using the following inputs:
- Standard Metrics (e.g., Total Engagement Count, Unique Visitors)
- Custom Metrics (e.g., Member Count, Scores, Rewards, or Points)
- Constants (e.g., converting from USD to EUR currency at a rate of 1.31 * Revenue)
Example Calculated Metrics
Below are some example calculated metrics that you may frequently use. You can create comprehensive reports by linking these metrics to relevant reports under custom reports and associating them with appropriate dimensions.
Target Conversion Rate (conversion rate) can be calculated by dividing the number of visits completed by users by the target goal completion (goal completion). The target can be set to a specific goal that is meaningful to you. It should be noted that, especially on e-commerce websites, users often visit the site multiple times during their decision-making process. Therefore, a calculated metric such as user-level target conversion rate is a valuable metric for accurately calculating actual values based on user-level conversion data. You can customize the Ad and External Ad sections according to your preferences. The key fields to pay attention to are the Format and Formula fields, which can be structured as follows:
- Format: Floating (Float)
- Formula: Target Goal Completion / Users
Number of Products Viewed Per Transaction
Thanks to the Google Analytics E-commerce Setup (standard or enhanced), we can closely monitor the performance of products viewed during transactions through the Conversions > E-commerce > Product Performance report. Given that users often view multiple products before making a purchase and compare different products, we can turn these two pieces of information into a calculated metric and evaluate the number of products viewed per transaction. Additionally, you can extend this analysis by grouping products into content categories and analyzing performance at the product group level. Another recommendation would be to create a calculated metric specifically for tracking the performance of products added to the cart.
As the examples illustrate, calculated metrics are a highly functional feature that can be evaluated for specific scenarios and used in custom reports. Additionally, when combined with calculated fields in Looker Studio, it becomes possible to generate even more comprehensive reports. I will also delve into this topic and provide further examples in the coming sections. Below, I’m sharing a list of content featuring various examples that can be considered. I’d be delighted to include your own calculated metrics and the conveniences they provide in the article.
- Calculated Metrics in Google Analytics – Complete Guide
- Analytics (20 Examples Included)
- Complete Guide to Calculated Metrics in Google Analytics
- New Calculated Metrics In Universal Analytics
- Marketing the TNW Way #14: Calculated metrics in Google Analytics, 24 examples from The Next Web