How To Create Custom Metrics in Google Analytics
How To Create Custom Metrics in Google Analytics
Custom metrics are one of the most underutilised features of Google Analytics. Yet they can transform your analysis and reporting to give better insights from your Google Analytics data. They are also often a prerequisite for calculated metrics which enable you to pair related metrics to generate more meaningful insights. Custom and calculated metrics are also ideal for using in dashboards and visualisations. As they can connect important steps in the user journey.
Custom metrics are often essential for conversion rate optimisation. Google Analytics doesn’t allow you to use an existing calculated metric in the formula for a new calculated metric. This means that if you want to calculate a conversion rate between registration submission and successful registration. You will first have to create custom metrics for these two events in Google Analytics.
If you have migrated from hard-coded Google Analytics to Google Tag Manager, custom metrics are much easier to implement than if have not. In this post we will concentrate on using GTM to configure custom metrics.
1. What are Custom Metrics in Google Analytics?
Google Analytics has many useful predefined metrics, such as bounce rate, average time on page and session duration. These are generic metrics that don’t reflect the unique nature of your website or your customer base. A custom metric is a direct result of your own tagging of user interactions on your site, usually through Google Tag Manager.
Custom metrics are quantitative, which means they generate a cumulative average in a report. Furthermore, custom metrics are either hits or products (i.e. enhanced ecommerce tracking) rather than sessions or users. As a custom metric is cumulative this means it will generate the sum total during a session rather than the last recorded value. For example, if we allocate a value of 1 to each occurrence of the new metric (e.g. registration submission) every time users trigger this event GTM will push a value of 1 into the new metric.
By setting up custom metrics you can also import data from other sources to add to your Google Analytics data. This is often from your CRM system which you can correlate with GA data (e.g. call centre data, logged in data and customer satisfaction). This is a great way of trying to link up the off-line user journey with the online user experience.
2. Why Custom Metrics?
Events are fantastic for tracking user interactions, but if you want to turn them into ratios (e.g. conversion rates) by pairing them with other events you can’t get these metrics into Google Analytics. Setting them up as goals is probably the closest you can get, but you are limited to 20 goals in the free version of GA and goals are quite inflexible.
It can also be difficult to analyse events with dimensions in GA because of the way custom reports work. Events are great for creating custom segments and for using as filters, but they don’t easily fit into custom reporting with where you want to analyse metrics by multiple dimensions.
3. Which Custom Metrics should you Measure?
The easiest mistake you can make when thinking about custom metrics is by starting with the data and what you already measure. This will often mean that you end up measuring what you can measure rather than what necessarily drives the business forward. Revenues and costs are the primary drivers of profitability and so you need to consider how your website and optimisation activities can influence these metrics.
Ecommerce Performance Framework:
Optimisation expert Jonny Longden has created an Ecommerce Performance Framework (EPF) specifically for this purpose. He recommends you start by the defining your customer’s objective at each stage of the user journey. For example, how do you attract, connect, inform and convert prospects on your website. In addition, what does delivery look like from the customer’s perspective and how does the business nurture customers. If you don’t know the answers to these questions you can’t expect to be in a position to define your metrics.
This process forces you to break down and analyse the whole customer journey from your customer’s perspective. This enables you to clearly identify leading indicators that you should be measuring from the customer’s viewpoint rather than focussing on business KPIs. You can’t claim to be customer focussed if you don’t start with the customer.
In the example below we can see that as well as predefined metrics, like bounce rate and conversion rate, there are custom metrics like add to basket and shares. There are also calculated metrics like average order value (AOV) and margin which we will discuss later.
e-Commerce Performance Framework
Once you have defined the leading indicators for your organisation you will be in a better position to identify areas for optimisation. For example, if your aim is to get customers to buy direct from your website, as opposed to using aggregator (3rd party websites), you will need demonstrate the benefits of purchasing over 3rd party purchase. This means measuring metrics like bounce rate and product detail views. But it also tells us you need to work on optimising your value proposition, landing page experience, benefits messaging and user personalisation.
4. Setting up Custom Metrics in Google Analytics:
To set up a new custom metric in Google Analytics go to Admin > Custom Definitions > Custom Metrics and select +NEW CUSTOM METRIC.
Each custom metric has eight elements to it:
- Name: E.g. Submit Form
- Index: Starts from 1
- Scope: Hit or Product
- Formatting Type: Integer, Currency (Decimal) or Time.
- Last Changed: Date when edits were last made
- State: Active or Inactive
- Minimum Value: e.g. 0
- Maximum Value: E.g. 1
Custom Metric Scope:
The scope of a custom metric can either be a ‘Hit’ or a ‘Product’. When using the hit level scope, the value of the custom metric will only be allocated to the hit for which it has been set (i.e. the event in GTM). When using a product level scope, the value is only applied to the product for which it has been configured.
To use the product level scope, it requires enhanced ecommerce to be implemented on the website. We will concentrate on hit level scope custom metrics as enhanced ecommerce metrics can be covered separately.
Properties of Custom Metrics:
Custom metrics, just like custom dimensions, are set at the property level and not at view level. For the free version of Google Analytics, we are limited to 20 custom metrics per property, the same as for custom dimensions. For Google 360, users you can have up to 200 custom metrics and the same again for custom dimensions.
Just like GA goals, once you have set up a custom metric, you can’t delete it. You can edit it or disable it by unchecking the ‘Active’ checkbox. Google recommends that you don’t re-use a custom metric (e.g. change scope) for a new metric because of concerns about data integrity. Custom metrics values are sent to Google Analytics as parameters attached to other hits (e.g. events and page views) and so it can’t be sent after a hit has already been recorded.
5. How to Create Custom Metrics in Google Tag Manager
In the example of setting up custom metrics in GA above, you may have noticed I set up two metrics.
- Submit form
- Submission confirmation
To configure these two custom metrics in Google Tag Manager we just need to edit the event tags by adding the Index number and the metric value. So, if we go to the first tag (Submit Button Click), edit and click;
“Enable overriding settings in this tag” > More Settings > Custom Metrics > + Add Custom Metric.
We now need to match up the Index number from Google Analytics (in this case 1). Then give it a value of 1 so that it increases by one for each hit/event sent to Google Analytics. It can take Google Analytics up to 24 hours for custom metrics to become available in the console and so you will need to allow for this before testing.
Once data is coming though you can select your custom metrics to add to any custom report you create. Further, if you have created two related custom metrics, like for example Submit form and Submission confirmation, you can use calculated metrics to create a conversion rate from the two metrics. Go to my blog on how to create calculated metrics for more on this topic.
6. Data Visualisations in Data Studio:
Now that you have created your custom and calculated metrics you can use Data Studio, Google’s awesome free data visualisation tool, to set up dashboards showing absolute counts, but also conversion rates. This will allow you to see if changes to your site are having a positive impact on conversions. You can also automate complex funnel visualisations in Data Studio without having the limitations of goals.
Events are a great first step in understanding user interactions, but to enable deep dive analysis and the creation of calculated metrics, it’s important to consider the role of custom metrics.
The Ecommerce Performance Framework is a great tool to help you identify which predefined, custom and calculated metrics you should be tracking. This ensures you begin with the customer journey and customer’s objectives rather than the data. This is crucial to aligning your measurement plan with business goals. Further, by identify your leading indicators you will have a better understanding of how to optimise your site.
Custom metrics are easy to set up, but they can be incredibly useful for enriching your data in Google Analytics. Custom metrics also enable you to use calculated metrics to create ratios to link two different events together to measure important conversion rates. This means that you can include key ratios in dashboards and reports in both Google Analytics and Data Studio.