Get More Google Analytics Custom Dimensions

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:

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.

Google Analytics Admin menu under custom definitions you will find 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.)

Create a New Custom Dimensions in Google Analytics

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.

List of 7 custom dimensions in Google Analytics with message that 13 custom dimensions are left

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.

You can see this for yourself using the GA Debugger extension. With the extension enabled, go to your browser’s Developer tools and open up the JavaScript Console. 

Inside JavaScript Console, you should be able to see what data gets sent over to Google Analytics under the GA Debugger list.

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.

Some list of dimensions that will help us break our custom dimensions 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.

Flash Version  in the  Analytics.js Field Reference where you can see a field name flashVersion with Value Type text and Max Length of 20 Bytes

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.

In the Google Tag Manager Data Layer we will find the pagePostDate June 7 ,2013

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.

Creating a new User-Defined Data Layer Variable

Here, we’ll build a Data Layer variable for the pagePostDate. Give your variable an informative name, then select the Data Layer Variable type. 

Building a Data Layer Variable named dlv - pagePostDate

Copy the key pagePostDate into your Data Layer Variable Name, then click Save. This variable should become immediately available in preview mode.

Input Data Layer Variable Name pagePostDate which is copied from Google Tag Manager Data Layer

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?

In Google Tag Manager, Page View under Variables, Data Layer Variable  pagePostDate is available

Go back to Google Tag Manager, and under Tags, click on your existing Google Analytics pageview Tag.

You can find the Google Analytics - Pageview -All Pages to modify under Tags

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.

Setting up fields by adding information needed in sending Information to Google Analytics as the Fieldname and its Value

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’

In Tags Properties 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.

In the Developer Tools Console  you will find the  flashVersion that is  filled with post date

Don’t forget to Publish this to a Version live to all your users when you’re done!

Summary

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!

JOIN US!

Master Data & Analytics with Measuremasters

Exclusive Courses & Workshops | Ongoing Troubleshooting | Support Resources, Tools & much more
guest
0 Comments
Inline Feedbacks
View all comments

Blog Categories

Join 30,000+ marketers getting exclusive resources and our latest content!

now it's time to

Start measuring like a master

Itching to jump into the world of MeasureMasters? This is what you have to look forward to.