Ultimate Guide to Google Analytics Custom Dimensions and Metrics

The google analytics platform offers over 400 dimensions and metrics. Most of these dimensions and metrics are used every day and track common things like page, medium, sessions, users, and many more.


What if you need to track something very detailed and custom to your business? You can use events…right? I’m guessing that’s what most people are doing today.


Instead, try mapping out what you need to track so that it makes sense in the long-term, especially for the person doing the reporting and analysis. For goodness' sake, google isn’t storing all of their dimensions and metrics in the 'Event Category' or 'Event Label' fields. Take advantage of what Google is giving you and setup custom dimensions and metrics that you can customize to your business. You'll be thanking yourself later.


Download my custom dimension and custom metrics guide. This will help you get started. This guide is based on the most popular metrics that need to be tracked on most websites. I customized one section towards the hospitality industry as you'll see dimensions and metrics related to booking a hotel room. This will give you an idea of how to map to your business needs.

download - ultimate guide to custom dimensions and metrics

What is a Custom Dimension?

Custom dimensions are individual data points that you can pivot/group/filter off of. For example, device type is a dimension and holds 1 of 3 values (desktop, tablet, mobile). Think of dimensions as a distinct characteristic of users, sessions, or actions.

What is a Custom Metric?

Custom metrics are data points that are measurable in the format of a number, decimal, or time. For example, page load time is a metric and measures the amount of time in milliseconds to load a page.

How many custom dimensions/metrics do I get?

Premium Accounts

Custom Dimensions200
Custom Metrics200

Free Accounts

Custom Dimensions20
Custom Metrics20

Events vs Custom Dimensions/Metrics

First, let's define what an event is. An event is a type of hit that google accepts. Think of an event like a pageview, in that, both events and pageviews are hit types. Both are able to carry information and data from your website to Google Analytics. An event is typically sent to Google Analytics based on a user interaction, like a button click or playing a video.

The biggest disadvantage of events are that you generally need to create custom segments to see how events related to other metrics when doing analysis.

The biggest advantage of using custom dimensions/metrics over events is that you can slice and dice the data so much easier and take advantage of calculated metrics. In addition, you can select any custom dimension as the secondary dimension within any standard report. See here.

Google Analytics - Reports

Here is an example of a secondary custom dimension within a standard report.

Google Analytics - Reports

How to Create Custom Dimensions?

First, you must have 'Edit' permissions on the Google Analytics property to create and edit custom dimensions. You can create custom dimensions by navigating to the 'Admin' tab and selecting custom dimensions within the custom definitions section in the property settings.

Custom Dimension Step 1


Click the 'New Custom Dimension' button

Custom Dimension Step 2


Name: Give your custom dimension a friendly name

Scope: Identifies how the custom dimension will be reported (Hit, Session, User, Product)

1. Hit: Applies to 1 individual hit. (Example: 1 pageview)

2. Session: Applies to all hits for any session. (Example: Source/Medium)

3. User: Applies to all hits for any visitor. (Example: Gender)

4. Product: Applies to each product (if enhanced ecommerce is enabled). (Example: SKU)

Active: Specifies if the custom dimension is active/inactive (inactive dimensions will still be listed in reports, but no data will be available for period(s) of inactivity).

Please note you cannot delete a custom dimension. Also, it is not a best practice to repurpose custom dimensions, but if you must, create an annotation in your Google Analytics Property to note the change.

Custom Dimension Step 3


How to Create Custom Metrics?

Again, you must have 'Edit' permissions on the Google Analytics property to create and edit custom metrics. You can create custom metrics by navigating to the 'Admin' tab and selecting custom metrics within the custom definitions section in the property settings.

Custom Dimension Step 1


Click the 'New Custom Metric' button

Custom Metrics Step 2


Name: Give your custom metric a friendly name

Scope: Identifies how the custom metric will be reported (Hit or Product)

1. Hit: Applies to 1 individual hit. (Example: 1 pageview)

2. Product: Applies to each product (if enhanced ecommerce is enabled). (Example: Quantity)

Formatting Type: Identifies how the custom metric will be reported (Integer, Currency, Time)

1. Integer

2. Currency (Decimal)

3. Time

Minimum Value: Identifies the minimum value that will be reported

Maximum Value: Identifies the maximum value that will be reported

Active: Specifies if the custom metric is active/inactive (inactive metrics will still be listed in reports, but no data will be available for period(s) of inactivity).

Please note you cannot delete a custom metric. Also, it is not a best practice to repurpose custom metrics, but if you must, create an annotation in your Google Analytics Property to note the change.

Custom Metrics Step 3


Populating Custom Dimensions and Metrics

It’s important to point out that a custom dimensions/metric cannot be sent to Google Analytics by itself. It must travel on a hit (event, pageview, e-commerce, or social). How do you send it? This will depend on your implementation (using JavaScript with Universal Analytics or Google Tag Manager). So let’s cover both.


1. Universal Analytics

To populate a custom dimension or metric using JavaScript, you will set the custom dimension/metric prior to sending the hit. First, you need to know the index of the dimension/metric that you need to populate. The index is in the Admin settings where you defined the custom dimension/metric.

Custom Dimension Step 4


Populate the custom dimension/metric before calling the pageview or event. Here we are populating custom dimension #3 with the value of 'variant a' and custom metric #1 with the value of 1.


2. Google Tag Manager

In this example, we’ll populate the custom dimension from a data layer and send it on a pageview.

A. Define a variable to hold the value that you wish to pass into the custom dimension. In this example, I'm getting the 'AB Test' value from the data layer to store in my variable 'abTest'.

Google Tag Manager - Variable


B. Edit the pageview tag

i. Edit the 'Configure Tag' section

ii. Expand 'More settings'

iii. Expand 'Custom Dimensions'

iv. Click 'Add Dimension'

v. Enter the index number

vi. Enter the value as the variable name created in step 1

Google Tag Manager - Custom Dimension

Validation

Let’s not forget to verify the data is being sent on the hit or image beacon to Google Analytics. I recommend using a browser plugin to capture and log the data. My favorite is Omnibug. It's available for Chrome and Firefox. If you go with Firefox, you’ll also need the Firebug plugin.

1. Open the developer tools (F12).

2. Select the last tab is called Omnibug.

3. Each hit will be displayed in a list within Omnibug. Expand the item and you will see fields on the left side and the associated values on the right side. This is an easy way to see the data that is being sent to Google Analytics. The custom dimensions will be at the bottom. Here is cd42 which is custom dimension 42 and the value assigned on the right side. If you see your data here and a valid 200 status...congrats!

You passed validation!

Omnibug

Reporting

It’s important to note that custom dimensions cannot be viewed in real-time reports. Moreover, the processing of custom dimension takes longer than regular dimensions, so you will need to wait a couple hours before you will see them in your reports. Once they are available you can create a custom report by navigating to the customization tab.

Google Analytics - Reports - Step 1


Give your report a title and name. Then select the metrics and dimensions. Optionally, you can add filters. In my case, I'm selecting the custom dimension A/B Test.

Google Analytics - Reports - Step 2


Run your custom report. Here I see my report including the custom dimension: A/B Test.

Google Analytics - Reports - Step 3


Troubleshooting

If you do not see custom dimension/metric data in your reports, you will need to verify that you are reporting from the correct view. Also, double check your filters to be sure you are not filtering out your data. If you are still not seeing the data then try reporting from an unfiltered view. Please feel free to reach out by entering your comment below.

Share this

About

Brad Booth is a Digital Analytics Implementation Professional. He works with the implementation and analysis of Google Analytics and Google Tag Manager. He is also certified with Ensighten Tag Manager. Before focusing on analytics, he was a web developer. Things you didn't know about Brad: he lives in sunny Phoenix, Arizona. He played football in college and semi-pro. He enjoys working out and eating/cooking healthy.

Comments (2)


Leave a comment?


Syed Zaidi07/21/2016
So we have custom dimensions and when trying to report on them it will automatically filter out and not show the data in reports where that custom dimension was not set. How can we include these rows with some default value in our reports. We are using Reporting API V4 for it.
Brad Booth07/21/2016
Correct, if you did not set a value it will not be available for reporting. Consider setting a default value when one does not exist. Then, it will be available for reporting and you can filter on the rows that you need. Another thought would be to change the scope of the custom dimension if you need to report at a hit, session, or user level and the custom dimension was not scoped at the correct level.

© 2018 CampaignTail. All rights reserved.