1. Home
  2. Docs
  3. Google Tag Manager Guide
  4. Google Tag Manager Practical Guide
  5. Setting Up Custom Dimensions

Setting Up Custom Dimensions

In this section I will explain how to set up custom dimensions.  Assume that we are setting the user dimension this time. We will put the user level information on the page in the form of JS variables, and then get it through the variable of Google Tag Manager to set it as the custom dimension.

Setup Process

1、Create a custom dimension in Google Analytics

Click “Admin”→ “Custom Definitions” → “Custom Dimension” → “+ New Custom Dimension” in Google Analytics, There is a scope here, including Hit, Session, User, and Product. This is a custom dimension that you want to pass. The user level is tied to the user, so it is the User level.

Setting Up Custom Dimensions

Specific settings such as:

Setting Up Custom Dimensions

and then write down its index value. This is the index value is 3. This index value will be used later.

2、Put user level information on the page

This requires development support. The user level information is put on the page in the following format:

<span style="font-size: 12pt;"><script>

This is actually a JavaScript variable.

2、User variable to get user level information

In Google Tag Manager click “Variables” → “New” → “Select a variable type to start setting …” → “JavaScript Variables”, The specific configuration is as follows:

Setting Up Custom Dimensions

The Global Variable Name is filled with the name of the JavaScript variable placed on the page.

3、Turn global variables into custom dimensions

In the Google Analytics default tracking code, we are here to set the basic tracking code through google analytics settings, so we need to configure in Google Analytics Settings:

Setting Up Custom Dimensions


Find the custom dimension in “More Settings” and configure it as shown:

Setting Up Custom Dimensions

Index is filled with the index we created in Google Analytics, and the value is the variable User Level. Then save it.

4、Preview  and Publish

Click Preview in the upper right corner, and you can publish without any problems.


To use a custom dimension, you need to first determine the level of the custom dimension, whether it is Hit or Session, or User, Product, and the first three are generally used. The way to judge is to see how long this customization is the dimension life cycle before it changes.


If you don't understand, You can leave a comment below.
Tags , , ,