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?
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.
Here is an example of a secondary custom dimension within a standard report.
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.
Click the 'New Custom Dimension' button
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.
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.
Click the 'New Custom Metric' button
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)
2. Currency (Decimal)
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.
Populating Custom Dimensions and Metrics
1. Universal Analytics
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'.
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
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!
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.
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.
Run your custom report. Here I see my report including the custom dimension: A/B Test.
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.