How To Add Custom Dimension In Google Analytics

Google Analytics is an effective instrument offering crucial insights into the performance of your website. A notable capability it has is the incorporation of custom dimensions. This feature enables the tracking of distinct data points that are particularly relevant to your business or sector.

Introduction

In this article, we will guide you through the process of adding a custom dimension in Google Analytics. We will cover the following steps:

  • Define your custom dimension
  • Create a new property in Google Analytics
  • Configure your custom dimension settings
  • Implement your custom dimension code on your website
  • Verify that your custom dimension is working correctly

Define Your Custom Dimension

The first step in adding a custom dimension to Google Analytics is to define what data point you want to track. This could be anything from the type of product a user purchased to their location or device type.

Example: Tracking User’s Location

Let’s say you want to track the location of your website visitors. To do this, you would define a custom dimension called “Location” and set its scope to “User”. This will allow you to see where your users are coming from on a per-session basis.

Create a New Property in Google Analytics

Once you have defined your custom dimension, the next step is to create a new property in Google Analytics. This will allow you to separate your custom dimension data from your other analytics data and make it easier to analyze.

Example: Creating a New Property

To create a new property, log in to your Google Analytics account and click on the “Admin” tab. From there, select “Create Property” and enter the necessary information, such as the name of your website and the industry it operates in.

Configure Your Custom Dimension Settings

After creating a new property, you will need to configure your custom dimension settings. This includes setting up the data type, scope, and other parameters that determine how your custom dimension data is collected and displayed in Google Analytics.

Example: Configuring Custom Dimension Settings

To configure your custom dimension settings, navigate to the “Custom Definitions” section of your Google Analytics account. From there, select “Custom Dimensions” and click on the “New Custom Dimension” button.

Enter the name of your custom dimension, such as “Location”, and select its data type. In this case, we would choose “City” as the data type since we are tracking the location of our users. We would also set the scope to “User” so that we can see where each user is coming from on a per-session basis.

Implement Your Custom Dimension Code on Your Website

Once you have configured your custom dimension settings, the next step is to implement the code on your website. This will allow Google Analytics to collect and display your custom dimension data in real-time.

Example: Implementing Custom Dimension Code

To implement your custom dimension code, you will need to add a few lines of JavaScript to your website’s tracking code. This code will tell Google Analytics which data point you want to track and how it should be displayed in your reports.

For example, if we were tracking the location of our users, we would add the following code to our tracking code:

ga('set', 'dimension1', 'Location');
ga('send', 'pageview');

Verify That Your Custom Dimension Is Working Correctly

Finally, it’s important to verify that your custom dimension is working correctly. This can be done by checking your Google Analytics reports and ensuring that the data you are collecting matches what you expected.

Example: Verifying Custom Dimension Data

To verify your custom dimension data, navigate to the “Custom Definitions” section of your Google Analytics account. From there, select “Custom Dimensions” and click on the name of your custom dimension.

You should see a table displaying all of the data points that you have collected for this custom dimension. If everything looks correct, then you can be confident that your custom dimension is working as intended.

Conclusion

In conclusion, adding a custom dimension to Google Analytics is a powerful way to track specific data points that are unique to your business or industry. By following the steps outlined in this article, you can easily add a custom dimension and start collecting valuable insights into your website’s performance.