Custom dimensions are very useful for analyzing data that Google Analytics doesn’t automatically track, but it’s usually limited to only 20 per free account!
Want to squeeze more out of your custom dimensions? Here’s a little trick to break through the limit and make use of unused dimensions.
Here’s an overview of what we’ll cover in this guide:
- What are custom dimensions?
- How custom dimensions work in Google Analytics
- Replacing unnecessary default dimensions with custom dimensions
Let’s dive in!
What are Custom Dimensions?
Custom dimensions are just like any other dimension in your Google Analytics account—except you create them yourself! These custom dimensions can help you collect and analyze data that Google Analytics doesn’t automatically track.
Custom Dimensions are a vital feature for giving your data more context in Google Analytics.
Let’s say you have a blog post and you want to track its author, publication date, or word count in Google Analytics. You can do all this and more with the help of custom dimensions.
This could also apply to product details in an eCommerce shop, or user interactions in a website activity. Any aspects or characteristics of a user interaction you want to track can benefit from custom dimensions.
Unfortunately, in the free version of Google Analytics, there are only 20 custom dimensions available for you to fill. This could be a problem if you have lots of custom data that you need to track.
(If you’re not sure how you could possibly need more than 20 custom dimensions, check out this list of 50 custom dimensions used by The Next Web.)
But you don’t have to resign yourself to just 20 custom dimensions! Let’s learn how to work around this limit to enrich our data even more.
How Custom Dimensions Work in Google Analytics
If you haven’t built custom dimensions before, you can find them in the Admin panel of your Google Analytics property under Custom Definitions → Custom Dimensions.
And here is where you would input a New Custom Dimension that you could use to organize your data in Google Analytics. (You can learn how to do this in our video tutorial on how to add custom dimensions with Google Tag Manager.)
All of these are custom dimensions that you can use to organize and enhance your data. You can configure these dimensions to pick up on any element in your website’s code or related to a user interaction. Then, you can filter and sort data by these dimensions in the Google Analytics interface.
Now, Google Analytics restricts this list to only twenty custom dimensions at your disposal.
If you run out of custom dimensions, Google Analytics will let you buy a license for the Google Analytics 360 product. But if you don’t need the full GA360 package, then I’ll show you a little trick to send in custom information outside of this custom dimension specification.
To understand why this workaround is successful, it’s helpful to understand how data is sent into Google Analytics.
This list will include some really important dimensions, like the page path (location) and the name of the page (title)—these are important for content-based sites or eCommerce shops.
But Google Analytics may also be tracking information that is less important to your tracking, such as the API version, the screen resolution, or the viewport size. These extraneous dimensions are what will help us break our custom dimension limit.
Replacing Unnecessary Default Metrics
If you’ve run out of custom dimensions, then you can simply reconfigure existing dimensions that aren’t useful to you.
For example, this eCommerce shop doesn’t require the use of Flash, so the flashVersion dimension is totally unnecessary. We can utilize this default dimension slot and send in our custom data instead.
How is this possible?
Well, first of all, let’s check out the Analytics.js Field Reference in the Google Analytics Developers Guide. This is where all fields that are sent over to Google Analytics are documented, including what values they need to hold or what restrictions they have.
Find the dimension that you’d like to replace (such as flashVersion) and examine its characteristics. For example, this field takes a text property with a maximum length of 20 Bytes. It also shows us an example value.
When our Google Analytics code executes, we could overwrite this field in order to send our custom information over to Google Analytics, and make it visible under the dimension of Flash Version in our interface.
So how would we do that? Well if you are working with Google Tag Manager, it’s actually pretty easy.
Pulling Value from the Data Layer using GTM
First, in Google Tag Manager, head into your Preview and Debug mode. In the Data Layer, look for a data point that you would like to use as a new “custom dimension” using our workaround.
Let’s say that we want to create a new dimension for the date that a blog post was published. In the Data Layer, there is a key called pagePostDate.
To use data from this key-value pair in our Google Analytics interface, we’ll need to pull this value out of the Data Layer using a Data Layer variable.
In Google Tag Manager, go over to Variables and click on New.
Here, we’ll build a Data Layer variable for the pagePostDate. Give your variable an informative name, then select the Data Layer Variable type.
Copy the key pagePostDate into your Data Layer Variable Name, then click Save. This variable should become immediately available in preview mode.
Sending Information to Google Analytics
Now on our example website, we should see the pagePostDate variable every time we load a blog post page.
But this data still isn’t available in Google Analytics as a pageview dimension—so how can we do this?
Go back to Google Tag Manager, and under Tags, click on your existing Google Analytics pageview Tag.
Now here is the handy trick.
Under More Settings, go to the Fields to Set option. In the Field Name, you can type in the name of an existing dimension that is unnecessary to your web analytics (in this example, flashVersion).
Then, fill the Value dynamically with your new Data Layer variable (in this example, pagePostDate). Finally, click the Save button.
Refresh your preview mode and webpage to trigger a new pageview with the updated Tag. You should see your Google Analytics pageview Tag with some updated data.
Next to Fields to Set, you should have your repurposed dimension alongside the dynamically filled Data Layer variable data. In this case, our Tag shows the flashVersion as ‘June 7, 2013’.
As weird as this looks, it’s correct! You may have to keep a key to your updated key-value pairs if some custom values might be confused for other data, but you’ll get all the data you need.
You can also see this in your GA Debugger by opening up your Developer Tools. Here, too, your “custom dimension” should be dynamically filled with your new Data Layer variable data. So we have actually overwritten one field with custom Data Layer information.
Don’t forget to Publish this to a Version live to all your users when you’re done!
So there you have it. This is how you can repurpose unused dimensions to enrich your data beyond the twenty custom dimensions allocated to your free Google Analytics account.
What are the most important custom dimensions in your tracking system? Do you have other workarounds that help you use more than twenty? I’d love to hear your thoughts in the comments below!