Google Analytics allows you to segment and filter on 100+ preconfigured dimensions. This post dives deep into custom dimensions and how to use them to expand your Google Analytics data collection and greatly enhance your data insights.
Custom dimensions allows you to attach useful, additional information to hit, session, user and product data that you can send to Google Analytics.
Unfortunately, I have seen many companies not yet leveraging this unique feature in Google Analytics. And keep in mind that the dimensions available on default have their limits.
Read this in-depth post if you want to learn how custom dimensions can take your Analytics insights and optimization to the next level!
Table of Contents
- Introduction to Custom Dimensions
- Custom Dimensions: Four Stages
- Custom Dimension Examples
- Concluding Thoughts
Introduction to Custom Dimensions
Custom dimensions allow you to send extra information to Google Analytics. You can send dimension data that is already available on your website or non-Analytics (e.g. CRM) data.
In contrast to Content Grouping – which allows you to bucket your existing pages into logical groups – custom dimensions let you attach new data to hits, sessions, visitors or products.
- You run a dating website and have gender data stored in your CRM. If a visitor logs in you can retrieve this information and send it into GA together with the pageview.
- You run an ecommerce website and some of your items are out of stock. Setting up a custom dimension that captures the availability of the product is a smart way to analyze the (general) impact of not available products on performance.
Limitations and Prerequisites
Custom dimensions are not available in Classic Analytics, so if that’s you, make sure to migrate your tracking to Universal Analytics asap.
It requires both changes in your implementation and configuration which I will explain about later.
There are 20 custom dimension slots in a Google Analytics Standard account, and 200 slots in a GA 360 account.I haven’t encountered Google Analytics properties on GA 360 without a free slot. On the other hand, setting up 20 relevant custom dimensions is definitely possible for most companies!
Two more things to keep in mind:
- It’s impossible to delete custom dimensions after you create them.
- It’s possible to (temporarily) disable custom dimensions. This could be useful in the implementation phase.
Setting up and analyzing custom dimensions is usually done in four different phases.
1. Planning and Configuration
Get together with your Measurement and Analytics team. What is important to measure as a custom dimension and why? Make notes and develop an initial custom dimensions plan.
First, you need to define custom dimensions at the property level. This is required to send custom dimension data into Google Analytics.
Custom dimensions are defined in the admin section of Google Analytics. Edit level user access is required to configure custom dimensions in GA.
Three steps to get this done:
Step 1: navigate to the admin interface – Custom Definitions >> Custom Dimensions.
Step 2: click on + New Custom Dimension.
Step 3: fill in Name, Scope and State (active vs. inactive). Values are not processed if set to inactive.
The implementation of custom dimensions can be done hardcoded or via Google Tag Manager. Make sure to finish step one first before moving on to this phase.
In this chapter I will describe both methods (GTM implementation is preferred!).
Hardcoded Custom Dimension Implementation
You can find the exact code required in the official Google Analytics Custom Dimension documentation.
For dimension #1, the code looks something like:
var dimensionValue = ‘SOME_DIMENSION_VALUE’;
ga(‘set’, ‘dimension1’, dimensionValue);
Custom dimension values need to be set after the tracker is created and before a tracking call is made. This to be sure that the value is sent to Google Analytics.
- Match the dimension number in your implementation with the configuration in the admin section of your Google Analytics property.
- Implementing custom dimensions via Google Tag Manager is preferred; hardcoded implementations require on-page tracking code changes, cost a ton of time and are not really scalable.
GTM Custom Dimension Implementation
The second, preferred option is implementing custom dimensions via Google Tag Manager.
This section assumes you are familiair with the basics of GTM. If not, then I strongly recommend watching Measureschool’s GTM videos.
An example is shown below:
In this case a custom dimension is set when a visitor subscribes via the sidebar.
Get the configuration right in Google Analytics and Google Tag Manager and you are done!
Unfortunately most often it is more complex to implement your custom dimension.
The Data Layer in GTM is very flexible and sets you free from DOM scraping or other techniques to get the job done. Although it is much more flexible it requires assistance from developers to implement this on your website.
Your developer needs to make the required information available in the Data Layer before you can define it as a Data Layer Variable in GTM. The next step is to start using it in your tags.
Here is an example of a Data Layer configuration in GTM:
Review the Data Layer support documentation, make an action plan, sit down with your developers and get the job done.
“It might take a few hours extra (up to 24 hours) before the custom dimension information is actually shown in Google Analytics. Please be aware of that after you have implemented everything correctly. Use debugging tools if you want to test at an earlier stage.”
Processing is the last topic before we can dive into the exciting world of reports and optimization.
- When custom dimensions are processed, scope determines to which hits a particular custom dimension value will be applied.
- Filters in Google Analytics determine which hits and their (custom dimension) values are included in the reports.
There are four levels of Scope in Google Analytics. You can set the scope of each of your custom dimensions in the admin interface of Google Analytics.
Scope determines which hits will be associated with a particular custom dimension value.
Four levels of Scope
Value applies to the single hit for which it has been set.
Value applies to all hits in a single session. As the end result might be a bit confusing, you should review the bullet points below:
- The last value for the custom dimension applies to all hits in that session. Two hits, page A and B, the custom dimensions becomes active on page B. As it is a session scope dimension, the custom dimension applies to hit/page A and B.
- The latest value overwrites any previous values for that custom dimension. Three hits, page A, B and C. On page A no custom dimension value is set, on page B custom dimension value “morning” is set. However, within the same session on page C custom dimension value “afternoon” is set. In this case the value “afternoon” is applied to all hits in this session.
Value applies to all hits in current and future sessions.
- Custom dimension value doesn’t apply to previous sessions of same user.
- A value change leads to an updatet value stored in Google Analytics.
- Making it inactive in the admin interface stops processing custom dimension values.
Value applies to the product for which it has been set (requires Enhanced Ecommerce).
Google Analytics Filters and Custom Dimensions
The last important topic to understand is Filters.
Although daunting at first, they are really powerful (and destructive if used unwisely).
As explained before, custom dimensions are associated with the hit with which they were received, regardless of their scope.
Filtering that hit with a view filter may cause the custom dimensions to be filtered as well (depending on scope):
- Hit-scope: Custom dimensions are filtered if the hit they are associated with was also filtered. // IMPACT
- Session or User-scope: User or session-scoped custom dimensions are not filtered even if the hit they were attached to is filtered. Their values are still applied to all hits in the current session. And for the user scope, to future sessions as well. // NO IMPACT
For advanced users: usually you set up multiple views in a Google Analytics property. In the same way you could construct views for a specific custom dimension value. For example, a “Customer” filter. Be careful when applying filters and set up a test view first.
You can either include or exclude users based on certain characteristics.
4. Reporting, Analysis and Optimization
In and outside of Google Analytics you have a ton of options to analyze and optimize based on custom dimension data.
- Secondary dimensions are the fastest way to see custom dimensions in your GA data.
- Custom reports let you build large, complex tables of data with custom dimensions as primary dimensions instead of secondary dimensions.
- The Core Reporting API gives you access to custom dimension data to build your own charts and tables. For example, you can build dashboards that include custom dimension data in Google Sheets or Google Data Studio.
Here is an overview of custom dimensions available in the Google Analytics Demo Account:
- With read and analyze access you can add custom dimensions as secondary dimensions or use them in custom reports. However, you are not able to use them via the Google Analytics API.
- The Core Reporting API is only accessible if you have collaborate (or edit) access at the Google Analytics view level.
1. Secondary Dimension
In the table above you can see that the “Sales Region” custom dimension is a session-level scope custom dimension.
Google leverages the “data import” functionality to connect geographical data (Country ISO Code) to the custom dimension “Sales Region”.
This allows them to measure the performance (in terms of acquisition, behavior and conversion) at an aggregated level.
I will show this in more depth based on the following business question:
“Is there a major difference in ecommerce performance between Affiliates in the different Sales Regions?”
It will take a few steps to answer this question.
Step 1: navigate to Acquisition >> All Traffic >> Channels.
Step 2: click on the “Ecommerce” link (beneath Explorer).
Step 3: go to Default Channel Grouping “Affiliates”.
Step 4: add “Sales Region” as a secondary dimension.
Step 5: review your dataset.
In this case there isn’t a lot to say about Sales Region performance on the Affiliate level.
Simply because the number of transactions per Sales Region is too low to draw reliable conclusions.
The most important takeaway is that you can match a diversity of (custom) dimensions and metrics when analyzing your Google Analytics data.
2. Custom Report
The second option is to build a custom report with one or more custom dimensions.
You can build your custom reports in a variety of ways. Read this article to learn more about three common methods.
In the following example I have modified the Channel Report to build a custom report with one dimension: “Sales Region”.
It’s immediately clear that 99% of all revenue comes from the North America region.
You can add a drilldown dimension to quickly find out which devices are generating the most revenue.
Now you have the option to further drilldown on the dimension level:
Step 1: click on North America “Sales Region”.
Step 2: review the results.
In this example the Sales Region “North America” and desktop visitors are generating nearly all transactions for Google. It’s clear there is a lot of potential to further optimize their revenue stats. Setting up and analyzing your custom dimensions in custom reports can yield many new insights and optimization possibilities for your organization.
3. Google Analytics API
Last but not least, the Google Analytics Core Reporting API. In my experience the API is your best choice if you want to get the most out of your optimization efforts.
Getting your data out of Google Analytics and analyzing it in a different environment brings a ton of flexibility.
1. Google Data Studio
Google Data Studio is a great option if you want to leverage the Google Analytics API and custom dimensions for building your reports or dashboards.
As you can see below, they are available within your Google Analytics data source:
Read my post on Google Data Studio if you want to learn more about this tool in general.
Visualizing your custom dimension data in Google Data Studio dashboards is extremely powerful. It helps you to answer the most important business questions much quicker in comparison to solely focusing on plain, raw Google Analytics data.
2. Supermetrics Add-On and Google Sheets
Supermetrics is really powerful in multiple ways:
- Get metrics from multiple data sources into Google Sheets. Google Analytics is just one of them.
- Refresh reports automatically or by a click of a button.
- Schedule automatic emailing or give others access to your reports & dashboards.
- Connect your data sources immediately to Google Data Studio.
You can export your Google Analytics data and build beautiful reports without being an expert in technical API queries.
Supermetrics automatically takes care of the technical stuff from within an easy-to-use interface:
Further drilling down and adding extra data is easy:Here is a full dimension list of Supermetrics you might want to check out!
Personally I prefer building dashboards in Google Data Studio. The Supermetrics Add-on can help you to directly pull data into Google Data Studio via their awesome data connectors.
Custom Dimension Examples
In this chapter I share 15 Custom Dimension examples. These serve the purpose to inspire you to define your own set of custom dimensions. Don’t just simply copy them as each business is different!
User-Level Scope Custom Dimensions
1. Customer ID
This one is “gold”! Capture your visitors User ID if they log in to your website. You can segment your data and traffic by user ID and then match this data with your back-end system(s).
Keep in mind that you are not allowed to track personally identifiable information in Google Analytics.
Do you run a leadgeneration site? You will want to identify your leads once they hit the “thank you” page on your website.
This allows you to more narrowly analyze the behavior of this group of leads on your website.
3. Member Type
Many websites offer a wide range of subscription plans.
Here is an example of Qualaroo:
In this case Qualaroo could set up a membership Custom Dimension with four possible values:
- Turbo Growth
This allows them to better analyze the behavior and needs of each membership segment.
Update the user-scope level custom dimension if a visitor modifies their membership type.
Be aware that it might be hard to get reliable data for large companies as multiple users on different computers might access the Qualaroo site. However, the behavior of logged in users can more easily be tracked.
4. Fan Level
Let’s assume you run a blog website.
There are different levels of engagement per user (fictional):
- Reader: user who visited at least three blog pages.
- Commenter: user who left at least one comment.
- Subscriber: user who subscribed to your newsletter.
- Customer: user who bought one of your products or services.
Segmenting on this “engagement” levels can yield a ton of insights you would never get from the default dimensions and metrics in Google Analytics.
Session-Level Scope Custom Dimensions
5. Logged In
Capture a Boolean value of true or false to segment logged in vs. logged out visitors. This is very useful as you can retrieve what content each of the groups consume and what actions they perform.
6. Time of Day
Set a dimension of morning, afternoon, and evening to perform an in-depth analysis on time metrics.
7. Coupon Code
Used a promo code. This is different from the data you get from your ecommerce data; this is for the purpose of analyzing the behavior of visitors who used a coupon code during their session.
Use to record sessions where a chat was initiated. This custom dimension allows you to better analyze the effect of your online chat functionality on macro and micro conversions.
Hit-Level Scope Custom Dimensions
Capturing the author for each of your blogposts is a great way to leverage custom dimensions in Google Analytics.
10. Blog or Product Category
- Blog: send the blogpost category to Google Analytics if you run a blog with multiple blogpost categories.
- Ecommerce: send the product category to Google Analytics if you run an ecommerce business with multiple product categories.
11. Word Count
For blogs this is very interesting to capture in a custom dimension; it allows you to analyze the effectiveness of blog posts based on word count.
Product-Level Scope Custom Dimensions
In stock vs. out of stock. I have found this a very important CD to set on ecommerce websites.
13. Product Type
Sometimes you can buy “standalone” products and “add-ons”. It is a best practice to distinguish between both with a product-scope custom dimension.
14. Profit Margin
There are two ways to leverage profit margin in Google Analytics:
- Custom dimension: measure the profit margin as a percentage.
- Custom metric: measure the profit margin as a value.
Color or any other characteristic of your products is a perfect candidate for a product-level scope custom dimension.
It is all about generating extra insights from your data. Setting up relevant custom dimensions on your website can greatly enhance your potential insights and business success.
Custom dimensions can greatly enhance your Google Analytics data. In my opinion every website should set a couple of custom dimensions at least.
Start with easy to implement custom dimensions and take it from there.
- Organize an internal brainstorm to come up with custom dimension ideas for your unique business.
- As described in this article, plan the implementation of custom dimensions in four stages.
- Involve your developers early in the process as you most probably need them later on!
This is it from my side. Have you already implemented custom dimensions for your business? Happy to hear your tips and questions!One last thing... Make sure to get my extensive checklist for your Google Analytics setup. It contains 50+ crucial things to take into account when setting up Google Analytics.