Advanced GA Settings: Custom Metrics and Dimensions

Latest collection of data for analysis and insights.
Post Reply
tongfkymm44
Posts: 221
Joined: Sun Dec 22, 2024 3:21 am

Advanced GA Settings: Custom Metrics and Dimensions

Post by tongfkymm44 »

How do we differentiate metrics and dimensions in Google Analytics?
The two variables discussed collect information with different characteristics:

Metrics collect information about quantitative data. For example, number of page views, number of hits, sessions , average time on page, bounce rate…
Dimensions refer to qualitative variables. Examples of this type of variables are acquisition channels, types of visitors, keywords, type of device used, etc.
All the examples given appear by default in Google Analytics, but let's imagine, journalist email database for example, that we have a fashion e-commerce. Maybe we want to know the color of the best-selling t-shirts or from which postal code people buy the most from us. This is where sending personalized information through new dimensions comes into play, since GA does not know that we need to know this data if we do not tell it.

Other examples of cases where it can be useful to have these custom dimensions are the categorization of a blog, to know which categories of articles are the most read. Or go a step further and see which authors get the most visits.

Custom dimensions: configuration and scopes.
When creating a custom dimension, we must be clear about what we want to measure and how that information will be analyzed. Before talking about how these dimensions are structured, we must clarify that their configuration is done at the property level in the custom definitions section. In addition, we must keep in mind that there is a limit regarding this customization and we cannot create more than 20 custom dimensions.

In the following image we can see how these dimensions are structured:

Examples of custom dimensions and their configuration in Google Analytics
The three most important points in a custom dimension are:

Name should simply describe what is being measured as it will appear that way in reports.
Index , which is used to associate the dimension with the variables to be collected (we will see this in the next section).
Scope. Custom dimensions can be of 4 types depending on when or how the information is collected.
What are the different areas of a dimension?

Product – These types of dimensions can only be created in accounts with Enhanced Ecommerce enabled. The value of the variable is associated with the products for which it has been configured, for example, the price or color of a particular product.
Hit : In our example image, this would be the “Article Category” dimension. The value collected is associated with the hit or unique interaction for which we have established it. That is, in our case, this information would only be collected when a user accessed an article page. On the rest of the pages on our website, no type of information would be sent, as it is not necessary.
Session : The dimension value is applied to all hits in a session. In our example, the day of the week. This would allow us to break down the different interactions by knowing which day of the week each of the events is executed most frequently. This value remains stable throughout the entire session.
User : applies to the user, regardless of whether the session has already ended or not, until the value changes or the dimension becomes inactive. If we think about users registered on our website but with different subscription plans: free, standard and premium, for example, we could create groups with the different types of users registered on our page.
Sending custom dimensions to Google Analytics via GTM
Measure with us!
Now that we know what custom dimensions are and how we can configure them, the next step is to get the information to Google Analytics. How do we do this data sending? We have several options, including manually adding the code that Google Analytics creates when you create a new custom dimension:

Example of manual custom dimension code in Google Analytics
Another option, and the one we are going to focus on, is to send the content through Google Tag Manager. This tag manager allows us to easily and quickly update the pixels or codes that we want to add to the code of our website or app. In addition to injecting code directly, GTM allows us to access the data layer or dataLayer.

The dataLayer is a JavaScript variable that collects and allows us to send information from the web code to our tag manager. In this way, we can later send this data to any other tool such as Google Analytics or Google Ads. Thanks to this, the development team can establish dynamic variables to be collected in code (for example, the color of our ecommerce products). Later, and using these variables and GTM, we can collect this information and send it as a custom dimension to any other tool.

Once it is clear that through GTM we can directly create the variables or extract them from the code to obtain information in the custom dimensions, how do we configure this sending? To do this, it is essential that we pay close attention to the index of the dimensions we have created. This number is what will identify which of the new dimensions the information will be sent to:
Post Reply