Custom Dimension Tracking using GTM

How can we setup Custom Dimension tracking using GTM as Custom dimensions are essentially custom secondary dimensions that are configured through GA settings. 

It allows us to view additional data points or pieces of information alongside GA’s default hits.

Custom dimensions are boundless, allowing us to pull any piece of information found on a page, in the page source, in a dataLayer, URL, or GTM variable so that we can use them into our Google Analytics reports.

Custom dimensions consist of the following elements:

  • Index: the identifying number for our values.
  • Values: the specified data that’s sent.
  • Scopes: the type of value that’s collected.
  • Variables: what collects your value in GTM.

Before covering how to configure custom dimensions through Google Tag Manager, we’ll cover what scopes are and how to select the correct type.

Choosing the proper scope type is vital to having your custom dimension data properly attributed to hits in our GA reports.

Custom Dimension Scope Types

There are four scope types that we can specify for custom dimensions; all of which will provide varying levels of depth in the reports.

The following scopes are available in GA till now.

  • Product Scope
  • Hit Scope
  • User Scope
  • Session Scope

Custom Dimension Tracking using GTM

Custom Dimension Tracking using GTM is much easier to do than it is to understand how it works.

Create a custom dimension in GA.

Go to ‘Custom Dimensions’ under Admin > Property Settings > Custom Definitions.

  • Add a custom dimension. Define the dimension’s name, specify the scope type, and make sure ‘Active’ is checked.
  • Take note of the dimension number. GA will create a custom tracking code for those setting this up through hard-coding (which we are avoiding by setting it up in GTM).
  • The dimension number ‘1’, taken from where it says ‘dimension1’ in the highlighted box, is what associates the custom dimension name you just set with the index you’ll set in GTM.
  • Create your variable in GTM. Skip this step if you have already created your custom variables. This step will vary depending on the type of variable
  • Set the field name and value in your GA variable. Your Google Analytics property must be tracked through a Universal Analytics tag in GTM to set up custom dimensions with this method.
  • Expand the ‘More Settings’ field in your existing GA variable in GTM and set your ‘Field Name’ to match the name you defined in your custom dimension setting in GA. Then set the ‘Value’ field as the variable you are using to push values to GA.
  • Set the index and value under ‘Custom Dimensions’. Set the ‘Index’ to the number you noted from the code that GA created for you when you created your custom dimension. Then, set the same variable that pulls in the values you want sent to GA.
  • Preview, test and publish.

Need help with Digital Analytics? Get in touch:

Leave a comment