A Guide to Custom Dimensions in GA4 Setup

Online marketers need as much data as possible to analyze and optimize their advertising campaigns. But getting Google Analytics 4 to work correctly is more complex than adding a code snippet to your company's website. If you want a complete picture of your results, you must spend some time setting up data collection.

Often, more than the standard GA4 user or product data is needed. In this case, specialists can use Google Analytics 4 definitions, i.e., custom dimensions and metrics.

In this article, I'll explain the importance of custom dimensions and metrics, show you how to set them up using Google Tag Manager, and describe how to use custom definitions in Google Analytics 4 reports.

In this article, I'll explain the importance of custom dimensions and metrics

What are custom dimensions and metrics in GA4?

When you launch a Google Analytics 4 call, your website automatically collects some default data. This includes important information such as user identifiers and device information, a record of the site content with which the user interacts, and the user behavior on the site or in the mobile app.

If you need additional data on attributes, characteristics, or user interaction with web pages, you can configure custom dimensions and metrics.

These concepts are very similar, but there is one difference: a user-defined or event-driven custom dimension is usually represented by text. A custom dimension (metric) is always event-scoped and is the result of a quantitative measurement (average, ratio, percentage).

There are many ways to use custom dimensions and metrics. By customizing them, you can collect additional data about events or users, including 

  • search terms from sites that have a search function; 
  • data about the payment types selected by users when setting up the add_payment_info event; 
  • information about the color of the product in the add-to-cart event; 
  • percentage or numeric value of video playback at the time the event is triggered; 
  • information about the names of the sections of the site menu that the user clicks.

GA4 has several types of standard dimensions and metrics, as well as limits on their number per resource:

  1. User-scoped custom dimensions enable you to analyze the properties of website or app visitors. You can set up to 25 user-scoped custom dimensions in each Google Analytics 4 resource.
  2. Event-scoped custom dimensions enable you to analyze event properties, event values, or action status. The limit for setting such dimensions is 50 for a standard resource.
  3. Item-scoped custom dimensions. They are determined based on a specific event parameter within the items array. They can also be used to analyze an attribute of a product or service offered in an online store, e.g., color, size, rating, or product status. You can set up to ten parameters for a resource.
  4. Custom metrics are determined based solely on a specific event parameter and allow you to analyze data points from the event parameter. You can create up to 50 custom metrics in a standard GA4 asset.

Custom metrics are determined based solely on a specific event parameter

Custom metrics are determined based solely on a specific event parameter

Creating custom dimensions in GA4

There are two steps to the setup process:

  1. The GA4 event setup with definitions in Google Tag Manager.
  2. Registering custom dimensions or metrics in Google Analytics 4.

Let me describe each step of the setup process in more detail.

Custom dimension setup

First, you must set up an event to send a custom dimension using GTM. On the screenshot, the Preorder_2023 event is triggered when a specially marked link from a YouTube broadcast is clicked. You need to get the IDs of the first 50 user pre-order requests and pass them on to the sales team.

To set up an event-based custom dimension, use Event Parameters, and for user-based custom dimensions, use User Properties.

To set up an event-based custom dimension, use Event Parameters, and for user-based custom dimensions, use User Properties.

Next, create an event parameter. First, create a trigger that will launch the event. In the example described above, the tag was triggered when a pre-configured custom dataLayer event was activated. You can customize the trigger to the type of activator that suits you.

Next, configure the tag. Specify the Measurement ID (GA4 configuration tag) > Event Name. With these settings, the event will already be transmitted to the analytics, but you need to get an additional parameter of the pre-order ID. To do this, open the Event Parameters section and click Add parameter.

To do this, open the Event Parameters section and click Add parameter

Next, type the name of the parameter. In the Value field, add a variable that will return the data you need. GTM provides a large number of built-in variables for you to choose from. In my case, I needed to create a special variable that would pass the pre-order ID.

You can pass up to 25 parameters with an event. 

Below is an example of event settings with a custom dimension.

Below is an example of event settings with a custom dimension

After setting up the event parameters, add a trigger to activate the event and save the tag.

After setting up the event parameters, add a trigger to activate the event and save the tag

Check that the event is triggered in preview mode.

Check that the event is triggered in preview mode

Go to GA4 and check the correctness of the data in the DebugView mode. If the event is received and the parameters are passed, you can publish changes to the GTM container.

If the event is received and the parameters are passed, you can publish changes to the GTM container

Alternatively, you can check if the event arrives in real time from the GA4 interface.

Alternatively, you can check if the event arrives in real time from the GA4 interface

Registering custom definitions in GA4

Now, you must register custom definitions. In Google Analytics 4, go to Admin > Custom definitions.

In Google Analytics 4, go to Admin > Custom definitions

Click New custom dimension and fill out the fields.

  1. Enter the name by which the dimension or metric can be found;
  2. Select the scope;
  3. Enter a description—a brief explanation of what the definition means;
  4. Select or type the name of the parameter in the Event parameter field. If the name of the parameter in GTM is "preorder_id," specify it as such.
  5. Save the custom definition.

Click New custom dimension and enter the required data

After setting up and registering custom definitions, wait 24 hours to start seeing data in Google Analytics 4.

Custom dimensions in GA 4 reports

After sending events and custom definitions to GA 4, you can analyze the data using reports. Here are some examples of available reports and how to customize them.

Events report

This is an overview of all events sent to your analytics resource. Here you can see a list of events, and by selecting any of them, you can get acquainted with its data.

Here you can see a list of events and by selecting any of them you can get acquainted with its data

Explorations

This report allows you to analyze the data in more detail. The following reports are available in the explorations: free-form, funnel exploration, and path exploration.

Free form block

Free form block

In the Variables column, enable the custom dimension you created. It is now available for adding dimensions to the report. Add the required segments, dimensions, and metrics. Then, customize the tabs and analyze the data in a convenient format. If you do not see the custom dimension you created, make sure it is registered correctly.

For more details about customizing custom reports, see this article.  

For more details about customizing custom reports, see the article

Editing or deleting custom dimensions and metriсs

If a custom dimension you have set up contains an error, you can edit or delete it.

To do so, go to GA4 > Admin > Custom definitions. Select the desired dimension or metric and click the ellipsis on the right. Then select Edit or Archive.

Then select Edit or Archive

Conclusions

By setting up custom dimensions and metrics, you can collect more accurate data, create detailed reports, and tailor analysis to meet your goals.

When creating custom definitions, remember that

  • a custom dimension is either event-scoped or user-scoped, and a custom metric is always event-scoped;
  • GA4 has several types of standard dimensions and metrics, as well as limits on their number for one resource. You can learn more about the limits on the number of special dimensions and metrics in Google Help;
  • the process of setting up custom dimensions and metrics in Google Analytics 4 includes the steps of setting up a GA4 event with definitions in Google Tag Manager and registering custom dimensions or metrics in Google Analytics 4;
  • after setting up and registering custom definitions, wait 24 hours to start seeing data in Google Analytics 4;
  • after sending events and custom definitions to GA 4, you can analyze the data using the Events or Explorations reports;
  • if you find that the custom dimension you have set up contains an error, you can edit or delete it.
Topics:
4
2
Found a mistake? Select it and press Ctrl + Enter