How to Create Custom Dimension in Google Analytics 4
A fresh Google Analytics 4 setup gives you plenty of useful information right out of the box, like where your users are coming from and which pages they visit. But the deepest insights come from tracking the data that is genuinely unique to your business. This is where GA4 custom dimensions come in. This guide will walk you through exactly what custom dimensions are, why you need them, and how to create them step by step.
What Exactly Are Custom Dimensions in GA4?
Think of standard dimensions in Google Analytics as the columns that are already in your spreadsheet by default - things like Country, Device Category, and Page path. These are helpful for everyone.
Custom dimensions are extra columns you add yourself to track information specific to your website or business model. They let you slice and dice your data in ways that matter most to you, answering questions that GA4 can't answer on its own.
For example, GA4 can't automatically tell you:
- Which blog authors drive the most traffic?
- Which of your SaaS pricing tiers has the highest engagement?
- Are logged-in users more likely to convert than guest users?
To answer these questions, you need to send custom data to GA4, and custom dimensions are how you make that data usable in your reports.
Event-Scoped vs. User-Scoped vs. Item-Scoped: Which Do You Need?
Before you create a custom dimension, you need to decide on its "scope," which essentially tells GA4 how long that piece of information is relevant. There are three main scopes to choose from in the free version of GA4, and getting this right is half the battle.
Event-Scoped Custom Dimensions
An event-scoped dimension applies only to the specific event it was sent with. Think of it like a sticky note attached to a single action. Once that action is over, the sticky note is gone.
- When to use it: When you need to add context to a particular interaction.
- Example 1: You have a blog and want to track the author of each article that gets read. You could create an
author_namedimension. This information is only relevant for thepage_vieworarticle_readevent for that specific blog post. - Example 2: You have two contact forms on your site: a "Sales Inquiry" form and a "Support Request" form. When a user submits a form, you can send a
form_typedimension to distinguish which form was completed.
User-Scoped Custom Dimensions
A user-scoped dimension applies to all future events for a specific user after it has been set. It's like putting a name tag on a person at a conference, the tag sticks with them wherever they go for the rest of the day.
- When to use it: For attributes that describe the user themselves, not just a single action they took.
- Example 1: You have different membership tiers like 'Free', 'Pro', and 'Enterprise'. When a user logs in, you can set a
membership_tieruser property. This allows you to segment your entire reporting view to see how 'Pro' users behave differently from 'Free' users across all their actions. - Example 2: You want to know if users logged into their accounts behave differently than guests. You could set a
login_statusdimension with values 'logged_in' or 'guest'.
Item-Scoped Custom Dimensions
This scope is specific to e-commerce tracking. An item-scoped dimension gives you more detail about a specific product in your online store. This data is only sent with e-commerce events like view_item, add_to_cart, and purchase that involve an array of items.
- When to use it: To add custom attributes to your products.
- Example 1: You sell t-shirts and want to analyze sales by color. You could create
item_coloras a custom dimension to see if black shirts outsell red shirts. - Example 2: You want to track manufacturer or brand information that isn't included in the standard GA4 e-commerce parameters. You could send this as an
item_branddimension.
With that understanding, let's walk through how to actually create these.
How to Create an Event-Scoped Custom Dimension (Step by Step)
Setting up custom dimensions is a two-part process. First, you have to send the data from your website (usually with Google Tag Manager). Second, you 'register' it in the GA4 user interface so GA4 knows what to do with it.
Let’s use an example: we want to track the name of the "Author" for each blog post viewing. Our goal is to see a report in GA4 showing sessions grouped by Author Name.
Step 1: Send the Data as an Event Parameter in GTM
First, you need to capture the author’s name and send it along with a page view. The easiest way to do this is with Google Tag Manager (GTM). The exact method for capturing data varies, but often involves a data layer variable, a DOM element variable, or a JavaScript variable.
For our example, let's assume the author's name is available in a data layer variable called dl.authorName.
- In GTM, navigate to your GA4 Configuration Tag or the specific GA4 Event Tag you want to modify (like a
page_viewtag). - Under Event Parameters, click "Add Row".
- In the Parameter Name field, enter a name for your data. This is what GA4 will see. Keep it short, descriptive, and use snake_case (e.g.,
author_name). - In the Value field, enter the GTM variable that captures the author’s name. In our case, this would be
{{dl.authorName}}. - Save your tag. Your configuration should look something like this:
Step 2: Preview and Verify with DebugView
Before you publish your GTM changes, always test!
- In GTM, click the "Preview" button and enter your website's URL.
- In a separate tab, open your GA4 account and navigate to Admin > Data display > DebugView.
- On your website in preview mode, navigate to a blog post. In the GA4 DebugView, you'll see a stream of events coming from your browser. Click on the
page_viewevent. - Look in the "Parameters" section. You should see
author_namelisted as a parameter, with the correct author's name as its value. If it's there, your tracking is working correctly! - If you see it, publish your GTM container.
Step 3: Register the Custom Dimension in GA4
Sending the data isn't enough. You have to tell GA4 to turn that parameter into a dimension you can use in your reports.
- In your Google Analytics 4 property, click the gear icon (Admin) in the bottom-left corner.
- In the Data display column, click on Custom definitions.
- At the top-right of the table, click the Create custom dimensions button.
- A side panel will appear. Now, fill out the details:
- Click Save.
And you're done! It may take up to 24-48 hours for the data to populate in your reports. After some time passes, you'll be able to add "Author Name" as a primary or secondary dimension in your Explore reports and see your website traffic broken down by author.
How to Create a User-Scoped Custom Dimension
The process for user-scoped dimensions is nearly identical, except for how you configure the GTM tag. Instead of "Event Parameters," you’ll use "User Properties."
Let's say we want to create a customer_tier dimension with values like 'Basic' or 'Premium'.
Step 1: Set a User Property in GTM
- This property would typically be set when a user logs in. You would create a new GTM tag that fires on a successful login event.
- Inside your Event Tag or Config Tag (if you want the info to piggy-back on existing functionality) open the User Properties section.
- Add a new row:
- Save the tag.
Step 2: Test with DebugView
Follow the same process as before. In DebugView, once the tag to set the user property fires, you'll see it listed in a separate "User Properties" section with its value.
Step 3: Register the Dimension in GA4
The UI steps are almost the same:
- Go back to Admin > Custom definitions > Create custom dimension.
- Fill out the form:
- Click Save.
Final Thoughts
Custom dimensions transform Google Analytics from a general-purpose tool into a razor-sharp analytics platform tailored to your specific business goals. By sending event-level data on specific interactions and user-level attributes on your audience groups, you can finally start answering the questions that generic metrics simply can't touch.
While powerful, setting this up and then pulling the data into clean, easy-to-read reports still involves a lot of manual steps. To simplify this, we built Graphed. Instead of logging into GA4 and navigating endless menus to build a report with your new custom data, you can just connect your sources in seconds and ask a question like, "Show me sessions by Author Name for last quarter as a bar chart.” We'll instantly give you the visualization you need without you needing to do all the heavy lifting.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.