New Calculated Metrics in Universal Analytics | LunaMetrics

New Calculated Metrics in Universal Analytics

/

blog-calculated-metrics-ua-tinypng
Finally, a long-awaited feature is available to all in Universal Analytics – calculated metrics! Google

Calculated metrics grant you greater flexibility in deriving insights by enabling you to perform basic calculations on metrics right there in the interface – without having to export data into Excel or another external program.

How to Create Calculated Metrics

Unlike custom metrics, calculated metrics are available at the View level, not the Property level:

calculated metrics at property level

Only five calculated metrics are available per view, unless you have Google Analytics Premium, in which case you will have 50 available calculated metrics per view. (This is in addition to the 20 custom metrics in standard Google Analytics or 200 custom metrics in Google Analytics Premium)

To configure them, click “+ NEW CALCULATED METRIC” and enter a name, formatting type and formula. In the example below, we are subtracting refunds from revenue:

calculated metrics

As you’ll see in the Formula section, basic operators are accepted and the metrics available appear with curly braces around them (just start typing in the field and your options will appear in auto-complete). Parentheses are also allowed (so you could add up the total of multiple goals, for example).

As you enter a Name for your calculated metric, a unique External Name will be created for you. This may be used for querying the via the Core Reporting API in the future, as mentioned in the description. You can edit the External Name, but it is not necessary to do so and you cannot change it once the calculated metric is created.

The formatting types available include Integer, Float, Currency, Time and Percent.

Using Calculated Metrics in Google Analytics

Calculated metrics can be applied in custom reports from under the “Other” category in the metrics drop-down list:

calculated metrics in custom reports

They can also be applied in Dashboard widgets:

calculated metrics in dashboard widget

Unfortunately, you cannot segment your standard reports with calculated metrics. (That would be awfully handy in some cases!)

Example Uses of Calculated Metrics

If you’re like most of us here at LunaMetrics, you’ve probably got a handful of use cases for calculated metrics already. Google suggests a few use cases, “Revenue Per User” and “Currency Conversion.”

Below are a few ideas from us to get you started!

Subscription Revenue

For subscription-based businesses, subscription revenue may be a useful metric. For example, you may have goals or events set up to capture new subscriptions and canceled subscriptions, which could then be used in a calculated metric. In this example, we have a goal value of $20 for subscriptions and a goal value of (-$20) for cancellations:

  • Name: Subscription Revenue
  • External Name: (automatically populated)
  • Formatting Type: Currency (Decimal)
  • Formula: {{New Subscription (Goal 1 Value)}} – {{Cancellation of Subscription (Goal 2 Value)}}

Revenue After Refunds

Additionally, the ecommerce reports in Google Analytics do not show a total revenue amount that accounts for refunds – but you can get that in the interface with a custom metric:

  • Name: Revenue After Refunds
  • External Name: (automatically populated)
  • Formatting Type: Currency (Decimal)
  • Formula: {{Revenue}} – {{Refund Amount}}

Total Goal Completions of Multiple Goals

If you have multiple Goals set up in Google Analytics that are similar in purpose, and you want to see the total number of those goal completions, you could add up the goal totals:

  • Name: Total Inquiry Goal Completions
  • External Name: (automatically populated)
  • Formatting Type: Integer
  • Formula: {{Contact – Phone (Goal 1 Completions)}} + {{Contact – Chat (Goal 2 Completions)}} + {{Contact – Email (Goal 3 Completions)}}
  • Total Goal Starts of Multiple Goals

Similarly, if you want to see the total amount of goal starts (entrances to steps in goal funnels) of multiple goals, such as to compare to the above total goal completions of multiple goals, simply add up the total goal starts:

  • Name: Total Inquiry Goal Starts
  • External Name: (automatically populated)
  • Formatting Type: Integer
  • Formula: {{Contact – Phone (Goal 1 Start)}} + {{Contact – Chat (Goal 2 Start)}} + {{Contact – Email (Goal 3 Start)}}

Sessions per User

This metric is available via the Core Reporting API, but you can create a calculated metric for use in the interface if you want access to it in there as well:

  • Name: Sessions Per User
  • External Name: (automatically populated)
  • Formatting Type: Integer
  • Formula: {{Sessions}} / {{Users}}

Pageviews per User

Similarly to Sessions per User, we can find out the average amount of pageviews per user:

  • Name: Pageviews Per User
  • External Name: (automatically populated)
  • Formatting Type: Integer
  • Formula: {{Pageviews}} / {{Users}}

Other User-Based Calculations

Oftentimes when dealing with user-based metrics, you’ll want to also consider the kinds of users on your website. It is generally expected that all users will have sessions and pageviews, but not all users will have transactions, goal completions and/or events, for example. So if you want to configure metrics calculated based on users, it is important to consider what your users should look like. The following examples provide a little more background on this concept.

Goals per User

Say you’re interested in learning how frequently users are downloading PDFs across multiple sessions (are they finding your content useful, are they coming back for more??). You have a goal set up to track PDF Downloads and you want to use a calculated metric to find the amount of goals per user. Your calculated metric would probably look like this:

user based calculated metric

However, it is important to consider what “Users” can mean here. Taken literally, it means all users who have come to your website (in the time frame selected) – but you can customize this definition with a little extra effort. Essentially, two basic options we’re considering for the definition of “Users” here could include:

  • Option 1: Look at all users – in other words, we’re asking “out of all users who have come to the site, how many PDF Download goals were completed?”
  • Option 2: Look at only those users who completed at least one PDF Download – here, we’re asking “out of only those users who download PDF’s, how many of these goals did they complete?”

You will likely want to use Option 2 to calculate your new metric based on only those users who completed at least one PDF Download so that your result is not heavily skewed by all those other users who did not complete this goal.

To do this, you will still keep your {{Users}} metric in your calculated metric formula – but you will need a little extra information as well in order to filter those users in a custom report: you need to identify those users who have downloaded at least one PDF with a user-level custom dimension.
For example, let’s say we have a custom dimension that is applied as soon as a link is clicked on the website that opens a PDF – we’ll call these users “PDF Downloaders.” With this custom dimension, we can filter our users in our custom report, which may look like this:

calculated metrics example

Here, “PDF Download Goals per User” is our calculated metric and our “PDF Downloaders” custom dimension is applied as a filter.

We could also get the total number of PDF downloads with an event instead of a goal, but we would need to use {{Total Events}} instead of {{PDF Download (Goal 1 Completions)}} in our calculated metric formula and then filter the custom report to specify the event category of PDF Download.

Transactions per User

Similarly to PDF Downloaders, we could create a custom dimension for users with transactions, which we could then use to filter a custom report based on the following calculation for transactions per user:

  • Name: Transactions Per Session
  • External Name: (automatically populated)
  • Formatting Type: Integer
  • Formula: {{Transactions}} / {{Users}}

Total KPI’s per User

How many KPI’s/events were completed by total users? The following will give you an average of users with events:

  • Name: Events Per User
  • External Name: (automatically populated)
  • Formatting Type: Integer
  • Formula: {{Total Events}} / {{Users}}

In a custom report, you could then filter to a specific event category if you wanted to see only certain events per user, such as video plays.

However – if you want a more specific number based on only those users who engaged with an event, you would again need to filter the users with a custom dimension:

  • Name: Events Per Users with Event
  • External Name: (automatically populated)
  • Formatting Type: Integer
  • Formula: {{Total Events}} / {{Users}}

Have you used calculated metrics yet? What are some useful calculations you have found?

Amanda Schroeder is an Analytics Engineer and comes from the marketing industry where she found a need for accurate, insightful data that could aid in making results-driven decisions. Amanda’s passion for building solid measurement strategies and connecting all the pieces of integrated digital and traditional marketing campaigns has led her to her current role at LunaMetrics.

  • Jarno

    Many of your suggestions are already built in Google Analytics. Such as multiple goal starts or completions, sessions per user and transactions per user. I would’ve liked to be able do calculations with segments sharing the same metric. But, that would then require the function in the reporting side per user-id, not editing rights per property (you need rights for property, although the metrics are view based).

  • raskal25

    interesting, we launched the same feature in our reporting tool 1.5 years ago- with the same name and functionality (only difference is that we use square brackets and Google analytics use }} . Good to see it becoming a standard 🙂 http://blog.kpiwatchdog.com/2014/04/do-you-want-to-calculate-conversion.html

  • http://www.remnet.pl/ Tomasz Ciepłucha

    You have an error in your formula when you calculate Revenue after refunds. You should use “Refund Amount” instead of “Refunds”, because “Refunds” reflects to the number of refunds not an amount of refunds.

    • Amanda

      Nice catch, thank you! This has been updated.

      • Matthieu de Groot

        Hi Same with the Transactions per user. {{User}} instead of {{Users}}

        • Amanda

          Thanks Matthieu, that one was a typo. Fixed!

  • http://www.3whitehats.co.nz Isaac Bullen

    Hi Amanda,

    Spotted a couple of errors in your code:

    1) You are missing closing brackets in your formula for example:

    {{Contact – Phone (Goal 1 Completions}} + {{Contact – Chat (Goal 2 Completions}} + {{Contact – Email (Goal 3 Completions}}

    Should be:

    {{Contact – Phone (Goal 1 Completions)}} + {{Contact – Chat (Goal 2 Completions)}} + {{Contact – Email (Goal 3 Completions)}}

    2) For ‘Total Goal Completions of Multiple Goals’, the formatting type you have suggested ‘Currency’ won’t work, you just need integer.

    Otherwise, a really useful article thank you.

    • Amanda

      Thank you Isaac! No more staying up late to write blog posts for me! This has been fixed.

  • http://leelkennedy.com Lee Kennedy

    Hi Amanda. Have you tried using constants in your calculated metrics at all? I’m trying to create a simple “Cost Per Lead” metric and I’m running into some trouble.

    I started with “{{Cost}} / {{Goal Completions}}”, which works fine, but I want to add their retainer spend in there too. So something like “( {{Cost}} + 10000) / {{Goal Completions}}”. But this doesn’t seem to work!

    • Amanda

      Hi Lee,

      I have not come across this problem personally, but I have heard others complain about it. I will do a little testing and try to figure it out.

      • http://leelkennedy.com Lee Kennedy

        Thank you, that would be great!

Contact Us.

LunaMetrics

24 S. 18th Street, Suite 100,
Pittsburgh, PA 15203

Follow Us

1.877.220.LUNA

1.412.381.5500

getinfo@lunametrics.com

Questions?
We'll get back to you
in ONE business day.