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.
Note: some of the links on this page are affiliate links. Link to affiliate disclosure.
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.
Two examples:
- 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.
Four Stages
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.
2. Implementation
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);
The value of the dimension is packed in a JavaScript variable. Then the set method with the ga() command is set to pass that variable to Analytics as a custom dimension.
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.
- Work with your developer to find the most optimal way to pass the dimension values into a JavaScript variable.
- 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.
3. Processing
“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
1. Hit
Value applies to the single hit for which it has been set.
2. Session
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.
3. User
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.
4. Product
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.
2. Lead
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:
- Startup
- Growth
- Turbo Growth
- Enterprise
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.
8. Chat
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
9. Author
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
12. Availability
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.
15. Color
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.
Concluding Thoughts
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 automated Google Analytics 4 Audit Tool. It contains 30 key health checks on the GA4 Setup.
Charles Meaden says
One of the great things about setting the custom dimensions via Google Tag Manager is that you can ‘stuff’ several values into them.
As there is a 150 character limit for each one, if you want to set 3 or 4 values into a hit level custom dimension when a page loads, you can separate each one with a separator such as tilde ~
{{value1}}~{{value2}~{{value3}}
It does require a good taxonomy from the outset to ensure there are no clashes, but it’s a worthwhile investment
Paul Koks says
Thanks for your suggestion Charles and I agree. Taxonomy is very important here, and in many more different cases as well.
Rob says
Hi. Very helpful article. It cleared several things up for me. I do have another question. This may sound like a stupid question but after reading countless blogs and looking at all the documentation I could find, I have yet to see a single example of what I’m asking about.
Can I add in my own custom dimensions and metrics into the Ecommerce Object in the Purchase actionField in the same way that you add product-scoped custom dimensions to the products array?
Modifying Google’s example, can I do this?
// Send transaction data with a pageview if available
// when the page loads. Otherwise, use an event when the transaction
// data becomes available.
dataLayer.push({
‘ecommerce’: {
‘purchase’: {
‘actionField’: {
‘id’: ‘T12345’, // Transaction ID. Required for purchases and refunds.
‘affiliation’: ‘Online Store’,
‘revenue’: ‘35.43’, // Total transaction value (incl. tax and shipping)
‘tax’:’4.90′,
‘shipping’: ‘5.99’,
‘coupon’: ‘SUMMER_SALE’,
‘metric1’: ‘10.00’, // Adding my custom metric – couponDiscount
‘dimension1: ‘No’, // Adding my custom dimension – IncludesAlcohol
},
‘products’: [{ // List of productFieldObjects.
‘name’: ‘Triblend Android T-Shirt’, // Name or ID is required.
‘id’: ‘12345’,
‘price’: ‘15.25’,
‘brand’: ‘Google’,
‘category’: ‘Apparel’,
‘variant’: ‘Gray’,
‘quantity’: 1,
‘coupon’: ” // Optional fields may be omitted or set to empty string.
}]
}
}
});
I have yet to see an example like this.
Paul Koks says
Hi Rob,
I believe it doesn’t work as you have to send product-scoped dimensions via the products[] array.
Maybe this is helpful to read.
Of course you can test it as well.
Cheers,
Paul
Rob says
I understand about the product scoped dimensions and metrics. The dimensions I’m trying to add are specific to the Transaction, which I thought would be Hit level scoped. For example, my dimension1 in this example is set to “No”. I set this by looping through all of the products in the array and checking to see if any of the products included alcohol. My hope was that I could run a report that would show all the Transactions and show a column with each Transaction called “Includes Alcohol” to see if a particular Transaction included a Product with alcohol.
Paul Koks says
Hi Rob,
I am sure you should be able to implement this; the thing is that I usually work with developers who take care of the implementation.
So, I recommend to ask this question in a GTM/GA specific forum.
Cheers,
Paul
Dhrubo Mukherjee says
Thanks Paul for your pieces of information.
Custom Dimension helps to measure first-time interactions as well as we can figure out the total number of interactions per user from the powerful analysis. Dimensions help to gather the accurate information of user’s interactions with something. This allows us to create additional user-level buckets based on returns. It needs serious brainstorming to try and track and analyze every aspect of data, Google analytics can offer.
Paul Koks says
Great use case Dhrubo! True, you can do a ton with custom dimensions. At the end it’s all about learning and optimizing your users’ performance.
TammyT says
We are trying to use a custom dimension to view bounce rate by different page variations. Our custom dimension shows up for metrics such as session count, but not for bounce rate. It is currently setup in the session scope. Is there something we are missing to get bounces attributed to a custom dimension?
Paul Koks says
Session scope should be good. Not sure what is happening there as I can correlate bounce rate to different types of custom dimensions. Are you running an AB test? And if so, have you tried firing events instead of setting a custom dimension for the page variations?
afshin says
hi poul, can you give an example about this
user scope: A value change leads to an updatet value stored in Google Analytics.
Paul Koks says
Hi Afshin, sure! Let’s say you offer a product in the basic, pro and platinum version. One customer signs up for basic and later on decides to upgrade to pro. This is when you want to switch the custom dimension value from basic to pro.
afshin says
another question:)
user scope:Making it inactive in the admin interface stops processing custom dimension values.
is this for all scope or just for user scope?
Paul Koks says
Happy to help! For all scopes and also for custom metrics. Inactive custom dimensions and metrics may still appear in reporting, but their values will not be processed. PS: my name is pAul ;-)
Caio Salvador says
Hi Paul,
Thank you for all the good articles that you make. I’ve learned a lot from them.
I have a question about the User-scoped fan level dimension. If I don’t have a user login system on my website where I could save this info, Is it possible to check the user fan level dimension on analytics before updating it? I mean, let’s say I a user came and subscribed to my newsletter and I’ve set its user-level custom dimension to “Subscriber”. However, after a few days, the same user comes back and takes another action on the website but less important. There is any way to check if that user is already a subscriber to not update and downgrade the user?
Paul Koks says
Hi Caio,
Good question. I think, on default Google Analytics will always overwrite the value in this case (takes the last value).
Two things that come to mind:
– Write code logic so that it doens’t overwrite the previous value in this case // never done before, you will need someone with dev background to look into this
– Implement this via a different user-scoped custom dimension so you can keep track of both actions.
Hope this helps in finding a solution!
Caio Salvador says
Thanks Paul, I’ll go with the second alternative. I’m a developer but I believe the second solution will be easier to implement and enough for what I need. Thanks!
Paul Koks says
Great, totally agree here!
NALISETH ANDREINAOR says
Hello
I have this situation
I have a news site. Every post has many post categorys. Example https://news.com/post1.html, where categorys for post1 :{‘sport’, ‘economy’}. https://news.com/post2.html categorys: {‘news’, ‘sport’}. Then i need count every category by post. On this example sport=2, economy=1, news=1..Is possible with GTM ? How can i do it?. Thanks
Paul Koks says
I am sorry, but I don’t fully understand your question. It sounds this is possible, but you will need the help of a developer to implement the dataLayer in the correct way. This in addition to the correct GTM setup.
dhyde says
Where should I put this code :
var dimensionValue = ‘SOME_DIMENSION_VALUE’;
ga(‘set’, ‘dimension1’, dimensionValue);
Paul Koks says
Hi there,
This need to be wrapped within the hardcoded Universal Analytics tracker and everything needs to be filled dynamically (by a developer).
However, nowadays most companies embed custom dimension via GTM and the Data Layer.
Best,
Paul
Jim says
Hi, might not bet related but I’m pushing through GTM’s datalayer and can successfully see the event but the default dimensions category and brand are still not set on product performance tab on ecommerce section in analytics.
Paul Koks says
Hi, there could be several reasons for this and probably you need to double check (with a developer) that the datalayer is built correctly to convey this information. Also, take into account a possible delay in some metrics/dimensions appearing in GA. Again, I can’t give detailed advice as there could be many reasons for this.
Kartik says
Hi Paul.
I tried creating a user variable in GTM that is of the type array of strings. I try to pass that array to GA/UA. Unfortunately, it does not work. Do you know of any workarounds?
Paul Koks says
Hi Kartik,
I am not sure how you can best resolve that in your case. Could you provide more details?