﻿ Google Analytics Calculated Metrics - Tutorial - Optimize Smart

# Google Analytics Calculated Metrics – Tutorial

‘Calculated metric’ is a type of user defined metric.  Another type of user defined metric is called the ‘custom metric’.

Calculated metrics are used to perform some very basic calculations on existing metrics. For example, the addition of two or metrics, multiplication of two or more metrics or dividing a metric by a constant etc. It is different from ‘custom metric’, in the way it is: configured, collected and processed in Google Analytics.

## Key differences between custom metrics and calculated metrics

#1 ‘Custom metric’ is configured/defined at the property level. Whereas, ‘calculated metric’ is configured at the view level.

#2 Custom metric is used to collect the data which Google Analytics does not automatically collect (like phone call data, CRM data etc). Whereas a ‘‘Calculated metric’ is used to collect/compute new data, from the already available data in GA.

#3 The values of a custom metric is processed and reported in GA, only when the new data is available in GA. Whereas, the values of the calculated metric is processed and reported, as soon as the calculated metric is configured. Because of this reason, you can see data for your calculated metrics, as soon as you set them up.

#4 Custom metrics do not work retroactively i.e. they do not collect and report on historical data. Whereas calculated metrics can work retroactively i.e. they can collect and report on historical data.

#5 Custom metrics are not compound metrics i.e. their value does not depend upon the value of other metrics. Whereas, calculated metrics are compound metrics. The advent of calculated metrics, provide the possibility of creating compound metrics in GA.

## Attributes of a calculated metric

A calculated metric has got the following four attributes:

1. Name
2. External Name
3. Formatting Type
4. Formula

## #1 Name

This is the web view name (or User interface name) of a calculated metric.

We identify a metric in a GA report, through its web view name:  Other examples of web view names: It is a good practice to use descriptive names for your calculated metrics, so that a recipient of your report, can easily understand, what the metric is all about and/or what data it is supposed to report upon.

For example, ‘CalcMetric1’ is a bad name for a calculated metric.

Newsletter Subscriptions Per Session’ is a good name for a calculated metric, as it clearly defines, what the metric is all about.

Note: You can change the web view name of a calculated metric, any time you like and it will work retroactively.

## #2 External Name

This is the ‘API name’ of the calculated metric.

When we access Google Analytics directly via API, we use the API name of a metric/dimension, instead of the web view name.

For example, the API name for calculated metric, we created earlier, is: ‘calcMetric_NewsletterSubscriptionsPerSession’: But you can change it to something else if you like.

However, once the calculated metric is set up, you can’t change its ‘external’/API name again: ## #3 Formatting Type

This configuration setting of the calculated metric is used to set the format in which GA should report on the values of the calculated metrics.

There are 5 formatting types available in GA for calculated metrics:

1. Float
2. Integer
3. Currency (decimal)
4. Time
5. Percent

You can select these formatting types from ‘Formatting Type’ drop-down menu: ## #1 Float (or Floating point number)

Float stands for ‘floating point number’. It is the number that has got digits after the decimal point.

A floating point number can be a positive or negative number but in the case of GA, it needs to be a positive number.

GA does not support negative floating point numbers for computing calculated metrics.

Following are examples of floating point numbers that are valid for creating a calculated metric:

2.34, 1.98, 3.00, .45, 9.0 etc.

Following is an example of floating point number which is not valid for creating a calculated metric: ‘-2.34’.

Also worth noting, is that Google Analytics can take into account, any number of digits after the decimal point, in its computation of calculated metrics, but always report floating point numbers with only two digits after the decimal point.

For example, the following formula:

{{Newsletter Subscription Confirmed (Goal 13 Completions)}} * .01

can produce different output, than the formula one below:

{{Newsletter Subscription Confirmed (Goal 13 Completions)}} * .006

or the formula one below:

{{Newsletter Subscription Confirmed (Goal 13 Completions)}} * .006009

Here GA is not going to round off the number .006 or .006009 to .01 but instead use the number .006 or or .006009 in computing the value of the calculated metrics.

However GA will always report a floating point number with only two digits after the decimal point and in case of reporting, may round off a number to the two decimal digits.

So if number of ‘Goal 13 completions’ is say 50,000 then the computed value for the calculated metrics could be:

50000 * .01 = 500.00

(according to the formula: {{Newsletter Subscription Confirmed (Goal 13 Completions)}} * .01 )

Or

50000 * .006 = 300.00

(according to the formula: {{Newsletter Subscription Confirmed (Goal 13 Completions)}} * .006 )

Or

500 * .006009 = 300.45

(according to the formula: {{Newsletter Subscription Confirmed (Goal 13 Completions)}} * .006009)

### #2 Integer

An integer is a whole number.

It is a number without a decimal point and it can be positive (like 12), negative (like -12) or Zero (0).

However, Google Analytics supports only positive integers and zero for computation of calculated metrics.

Negative integers are not supported.

### #3 Currency (decimal)

This configuration setting is used to format the value of a calculated metric as ‘currency’.

In the context of GA, currency is the combination of currency symbol and floating point number.

The currency symbol that is used, is the one that is set up under your view’s settings.

So for example, if pound is set up under ‘currency displayed as’ view setting: Then the values of your calculated metric will be displayed in pounds.

### #4 Time

This configuration setting is used to format the value of a calculated metric in hours, minutes and seconds format.

For example: 02:46:40

### #5 Percent

This configuration setting is used to format the value of a calculated metric in percentage format.

For example: 12%

Note: You can change the formatting type of a calculated metric, any time you like and it will work retroactively.

## Formula

The formula is an arithmetic expression that must return a numeric value.

An arithmetic expression is made up of numbers, arithmetic operators (+, -, *, / ) and sometimes parenthesis.

Following are examples of arithmetic expressions:

1+3

1-3

1*3+4.21 /100

100 + (1 +(250 / 108)) * 3.561

However, unlike regular arithmetic expressions, the expression used to compute calculated metrics can not be made up of just constants.

It must include at least one metric.

For example, the following formula is invalid when used for creating a calculated metric in GA:

10 + 5 However, the formula below is valid:

10 + 5 + {{Newsletter Subscription Confirmed (Goal 13 Completions)}}

You can use the following arithmetic operators in your formula:

1. + (plus)
2. – (minus)
3. / (divide)
4. * (multiply)

The order of operations (or operator precedence) is a set of rules that define which operation to perform first, in order to evaluate a given expression.

Operator precedence can be overridden by using parenthesis.

All the usual operator precedence rules are applicable for the expressions which are used as formulas for calculated metrics.

You can not use any negative value in your formula.

For example, the following formula is invalid:

{{Newsletter Subscription Confirmed (Goal 13 Completions)}} * -125

The length of your formula can not be longer than 1024 characters.

Parenthesis are allowed in a formula

Just like regular arithmetic expressions, the expression used to compute calculated metrics can include parenthesis.

For example, the following formulas are valid:

{{Newsletter Subscription Confirmed (Goal 13 Completions)}} / (10 + 5)

{{Newsletter Subscription Confirmed (Goal 13 Completions)}} / 100 + (1 +(250 / 108)) * 3.561

Square brackets are not allowed in a formula.

For example, the following formula is invalid:

{{Newsletter Subscription Confirmed (Goal 13 Completions)}} / 100 + (1 +[250 / 108]) * 3.561 GA automatically surrounds all metrics with double curly braces.

So for example, if you select ‘Revenue’ from the drop down menu, GA will surround the ‘Revenue’ metric with double curly braces {{Revenue}} : However, if you accidentally added one extra curly brace, your expression will become invalid: You can also use an expression as a formula which does not include any arithmetic operator.

For example, the following formula is perfectly valid:

{{Newsletter Subscription Confirmed (Goal 13 Completions)}}

The expression which returns a string or the expression which return a Boolean value (true or false), can not be used as formula for computing calculated metrics.

You can create a calculated metric which is based on the value of another custom metric. You can create a calculated metric which is based on the value of a predefined goal in GA: You cannot create a calculated metric that is based on another calculated metric(s).

Note: You can change the formula used for a calculated metric, any time you like and it will work retroactively.

## How to use up to 250 different calculated metrics for your analysis

Standard Google Analytics provide only 5 calculated metrics per view.

If you are using Google Analytics 360 (aka GA premium), you can then use up to 50 calculated metrics per view.

So if you wish to use more than 5 calculated metrics, while still using GA standard, you can do that, by creating 5 different calculated metrics for each view.

In Google Analytics, you can create 25 views per GA property.

So if you can create 24 duplicate views of your main view, you can technically, create and use 25 X 5 = 125 different calculated metrics for your website analysis.

Now if you use more than one GA property for your website by using multiple trackers, you can technically, create and use 125 different calculated metrics per property.

For example, I use two different GA properties for the OptimizeSmart.com website.

So technically, I can create and use up to 125 * 2 = 250 different calculated metrics for my website analysis.

Another advantage of using a second GA property is that I get to use, way more custom dimensions and custom metrics than any standard GA user.

For example, in GA standard you can create only 20 custom dimensions and 20 custom metrics per property.

But since I use two GA properties, I can create and use up to 40 custom dimensions and 40 custom metrics for my website analysis.

Technically, I can create and use dozen of GA properties for my website and can thus create and use hundreds of custom dimensions and custom metrics, far more than that are available in GA premium (200).

Of course, using so many trackers is going to have some ‘side effects’.

But what I am saying here, is that it is technically possible to increase the number of slots available to you (for custom dimensions/ custom metrics/ calculated metrics), at will, without paying the annual fees of US \$150k (the price to use GA 360).

## Stages for setting up calculated metrics

There are three stages for creating and using calculated metrics in GA:

1. Planning
2. Justification
3. Staging

### #1 Planning

At this stage, you determine your tracking requirements. What type of data you wish to collect via calculated metric.

### #2 Justification

Standard Google Analytics provide only 5 calculated metrics per view.

So you have limited slots available for calculated metrics, and if for some reason, you can’t increase the number of slots available to you, then you need to think twice, before using any available slot.

In the justification phase, you present a case study, which justifies your reasoning for choosing ‘calculated metric’ slot for tracking the type of data, you wish to collect in GA.

You can also the same justification for using a slot, meant for custom dimension or custom metric, as they are in limited supply.

There is almost always, some other method available, to collect and report your desired data.

In the justification phase, you explore all available options and make an informed decision regarding, whether or not to use a calculated metric slot.

Use a calculated metric slot only when it is absolutely necessary.

Avoid wasting slots for tracking trivial/vanity metrics like ‘blog views per user’, ‘average time per user’ etc.

I think it is a good practice, not to waste available slots, for tracking that website usage data, which does not really matter.

### #3 Configuration

At this stage, you configure GA view settings, in order to set up ‘calculated metrics’.

## Setting up a calculated metric in Google Analytics

To create a new calculated metric in Google Analytics follow the steps below:

Step-1: Determine your tracking requirements and make an informed decision regarding whether or not to use a calculated metric.

Step-2: Login to your Google Analytics account and then navigate to your main reporting view (the view that you use for analysis purposes).

Step-3: Navigate to the ‘admin’ section of your view and then click on the link ‘Calculated Metrics’ (under the ‘view’ section): Step-4: Click on the ‘+NEW CALCULATED METRIC’ button: Step-5: Enter a descriptive name for your new calculated metric, select formatting type (from the drop-down menu) and then enter your formula: Step-6: Click on the ‘create’ button to complete the setup: If you wish to copy or delete your calculated metric, just click on the drop-down arrow button next to ‘Actions’: ## Using calculated metrics in Google Analytics reports

You can use calculated metrics in any custom report and/or dashboard widgets.

However, calculated metrics are not available in standard GA reports.

To use calculated metrics, follow the steps below:

Step-1: Create a new custom report in your GA view.

Step-2: Navigate to the ‘metric group’ section of your custom report and then click on the ‘add metric’ button: Step-3: Enter the name of your calculated metric in the text box and then select it from the drop down menu: ## When to use calculated metrics

Calculated metrics are ideal, whenever you want to report on a compound metric in GA.

One of the most popular compound metrics is, ROI (Return on Investment)

Let us suppose you wish to report on the SEO ROI which is calculated as:

ROI= (Total E-Commerce Revenue from organic search – cost of running the SEO campaign) / cost of running the SEO campaign

The formula for calculating this ROI in GA may look like the one below:

( {{SEO Revenue}} – 3500 ) / 3500 Here, SEO revenue is a custom metric.

## Using calculated metrics via core reporting API

Instead of trying to retrieve the values of a calculated metric via the API, you can compute the value of the calculated metric within Google Spreadsheet. Step-3: Configure your new report by selecting the metrics and dimensions you want in your report.

Step-4: Click on the ‘create report’ button to create your new report. Run the report. You will then a see report data, like the one below: Here,

The metric ‘ga:goal13Completions’ track newsletter subscriptions.

The metric ‘ga:sessions’ track GA sessions on the website.

The dimension ‘ga:sourceMedium’ track traffic source and medium.

I selected these metrics and dimensions for my report because I want to calculate ‘Newsletter subscriptions per session’ for each traffic source.

Step-5: Now in order to calculate  ‘Newsletter subscriptions per session’, all I need to do is to create a new column, name it ‘Newsletter Subscriptions per session’ and then compute this metric by using the following formula:

ga:goal13Completions / ga:sessions

This is how this formula is going to look like in the Google spreadsheet: From this report, we can also conclude that the metric ‘Newsletter subscriptions per session’ is really not that great metric to track and analyze in GA.

This is because the Google Analytics reporting interface shows numerical values only up to 2 decimal points.

So numbers like ‘0.002305858444’ will be reported as ‘0.00’.

Ratio metrics are useful only when numerator and denominator are of comparable sizes which is usually not the case, esp. when you use ‘sessions’ or ‘users’ as denominator which, almost always dwarf any other GA metric that is used as numerator.

Because of this reason, ratio metrics are not very useful for analysis purposes.

For example, what useful insight you can get from ‘Newsletter subscriptions per session’ or ‘Newsletter subscriptions per user’ metric if its value is ‘0.002305858444’…. Nothing.

Also,

Average of an average = crap

Ratio metrics often suffer from statistical significant issues and do not reflect ‘effect size’ as accurately as number metrics.

To make matter worse, if the set of observed values vary by a large degree, then the average (or mean) is not a good representative of all the values in the data set.

In other words, you can not trust the average then.

For example, the average of the data set {1, 20, 3} is 8 which is not a good representative of the typical value in the data set.

Hence you can not rely on this average value.

Now imagine, you take an average of this average. So what you do expect to get now, other than ‘crap’.

Now since ratio metric in itself, is not very reliable and so when you take a ratio of a ratio, you could magnify all the issues associated with a ratio metrics by several folds and can thus make ratio metrics even less reliable.

So following metrics are innately BS:

• Conversion rate per user
• Average time on page per user
• Average time on website
• Bounce rate per session

So whenever you compute calculated metrics, based on sessions (per session) or users (per users), you need to be aware of the innate issues associated with ratio metrics.

Stick to number metrics wherever you can.

If you have to make business/marketing decisions based on ratio metrics, then also look at their composition (the size of numerator and denominator) and distribution of the values in the data set which was used to compute the average metric.

## Other articles on specialized tracking in Google Analytics

### What are the different types of calculated metrics?

The types of user defined metric are custom metrics and calculated metrics.

### What is a calculated metric?

A calculated metric is used to perform some very basic calculations on existing metrics. For example, the addition of two or metrics, multiplication of two or more metrics or dividing a metric by a constant, etc.

### What are the attributes of a calculated metric?

A calculated metric has got the following four attributes:
– Name
– External Name
– Formatting Type
– Formula

### How many calculated metrics does Google Analytics provide per view?

Standard Google Analytics provide only 5 calculated metrics per view.

If you are using Google Analytics 360 (aka GA premium), you can then use up to 50 calculated metrics per view.

## "How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."

Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

​#7 How to learn and master digital analytics and conversion optimization in record time.

## My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour. 