About calculated metrics [beta]

This Universal Analytics feature is merely available for websites using gtag.js or analytics.js. Using ga.js (Classic Analytics) will terminate Referral Exclusions from working.

Calculated Metrics are user-defined metrics that are computed from existing metrics and drive more than relevant analyses and enable greater actionability without leaving the product.

In this article :

  • Creating calculated metrics
  • Using the Formula field and input examples
  • Using calculated metrics
  • Employ cases
  • Related resource

Creating calculated metrics

To create a new calculated metric in Analytics follow these steps:

  1. Sign in to Google Analytics..
  2. Click Admin, and navigate to the view you want.
  3. In the VIEW cavalcade, click Calculated Metrics > NEW CALCULATED METRIC

Y'all'll then run into the Add together Calculated Metric interface:

Enhanced Ecommerce: Add Calculated Metric user interface

To create a calculated metric you need to populate the following fields and click the Create push when finished.

  1. Name – Provide a descriptive name (i.e. "Average Order Value"). This volition appear in the Metric selector for custom reports.
  2. External Proper noun – Automatically populated based on the value entered in the Name field and should not be modified. It can be changed from the recommendation during cosmos merely it cannot be changed later on it is created. The External Name value must exist unique.
  3. Formatting Blazon:
    • Integer (with customizable decimal places)
    • Currency (Decimal)
    • Fourth dimension
    • Float
    • Pct (with customizable decimal places)
  4. Formula – Start typing and you'll come across a list of predefined metrics which you can use to create a formula. Accepted operators include:
    • Plus (+)
    • Minus (-)
    • Divided by (/)
    • Multiplied by (*)
    • Parenthesis
    • Positive cardinal numbers (0-nine), tin can include decimals
    Using the minus operator as a negative is unsupported (i.e. A-B is supported, simply -B+A is not). Formulas are limited to 1024 characters. Up to 5 (Standard) and l (360) calculated metrics are supported at the view level.

Annotation: Using another custom calculated metric in the creation of a new calculated metric isn't supported.

Using the Formula field and input examples

The Formula field provides a quick mode to create and modify formulas using the following inputs:

  • Standard metrics – (eastward.g. Full Events, Unique Visitors)
  • Custom metrics – (due east.g. Number of members, scores, awards, or points)
  • Constants – (e.g. ane.31*Acquirement for currency conversion from USD to EUR)
    Best do is to add .0 to whole numbers, e.chiliad., xiii.0.

Note: Combining currency and non-currency values in the Formula field is non supported and may lead to unexpected results.

Using calculated metrics

Once created, calculated metrics are bachelor at query-time in the post-obit locations:

  • Custom reports
  • Custom Dashboards and widgets
  • Analytics reporting APIs

Note: In order to access a calculated metric via API, all constituent metrics must also be available by API.

Utilize cases

Example 1: Revenue Per User

CalculatedMetricsRevenuePerUser
  • Proper noun: Revenue Per User
  • External Name: (automatically populated)
  • Formatting Type: Currency (Decimal)
  • Formula: {{Acquirement}} / {{Users}}

Example 2: Currency conversion

CalculatedMetricsGBPtoEUR
  • Name: Revenue from GBP to EUR
  • External Name: (automatically populated)
  • Formatting Type: Currency (Decimal)
  • Formula: {{Acquirement}} * i.27
  • Understand the building blocks of your reports, Dimensions and metrics
  • About custom dimensions & metrics
  • Setting up custom dimensions and metrics in your account

Developer resourcesgoogle-developers-svg

Utilize the surroundings-specific instructions in our Programmer Guides to set up calculated metrics.

  • Website tracking: For Universal Analytics (the gtag.js JavaScript library)
  • Mobile app tracking: For Android and iOS mobile apps
  • Reporting APIs

Was this helpful?

How tin can we meliorate it?