How to Add Custom Dimensions in Google Analytics
Setting up custom dimensions in Google Analytics 4 is one of the most powerful steps you can take to understand your business beyond basic metrics like traffic and pageviews. It’s how you start tracking what truly matters to your specific goals, from authors and content categories to customer tiers and form submission types. This guide will walk you through exactly how to create, configure, and use custom dimensions in GA4 to unlock deeper, more relevant insights.
What Exactly Are Custom Dimensions in GA4?
Think of the standard data Google Analytics collects as "off-the-rack." Dimensions like City, Browser, Device category, and Traffic Source are pre-defined and available to everyone. They’re useful, but generic.
Custom dimensions, on the other hand, are tailor-made. They are user-defined dimensions you create to analyze data that GA4 doesn’t track automatically. This allows you to slice and dice your reports based on information that is unique to your website, app, or business model.
In Google Analytics 4, there are two primary types (or "scopes") for custom dimensions:
- Event-Scoped Dimensions: These dimensions describe a specific action or event. The value is only associated with the single event for which it was sent. For example, if you want to know which author wrote the article a user is currently viewing, that’s an event-scoped dimension attached to the
page_viewevent. - User-Scoped Dimensions: These dimensions describe an attribute of the user themselves. Once set, this value sticks with the user across all their subsequent events and sessions until it changes. A great example is
subscription_plan, which you could set to "Free," "Basic," or "Pro." You could then analyze all user behavior based on their plan.
Custom Dimensions vs. Custom Metrics
It's easy to get these two mixed up. The simplest way to remember the difference is:
- Dimensions describe your data. They are typically text-based attributes or categories you use to group things (e.g., Author Name, Subscription Tier, Product Category).
- Metrics count or measure your data. They are the numbers you see in your reports (e.g., sessions, users, conversion rate, revenue).
Today, we're focused on custom dimensions — the descriptive labels that give your data context.
Why You Absolutely Need Custom Dimensions
Standard reports can only tell you so much. They might show you that a blog post has high traffic, but they can't tell you if posts written by a certain author consistently perform better, or if content in your "Beginner's Guides" category leads to more newsletter signups.
Custom dimensions bridge that gap. Here are a few practical examples to illustrate their power:
For Content or News Websites:
You can create dimensions to track attributes of your articles.
- Dimension Idea:
author_name - Question It Answers: "Which authors drive the most traffic and engagement?"
- Dimension Idea:
post_category - Question It Answers: "Which content topics are most popular among users from organic search?"
- Dimension Idea:
word_count_bucket(e.g., Short, Medium, Long) - Question It Answers: "Do our long-form articles (4000+ words) have a higher engagement rate than short-form articles?"
For E-commerce Stores:
Go beyond standard product reports by tracking customer and session attributes.
- Dimension Idea:
customer_tier - Question It Answers: "Do 'Gold-tier' members have a higher average order value than 'Silver-tier' members?"
- Dimension Idea:
used_coupon - Question It Answers: "What is the conversion rate for users who viewed a product page after applying a discount code?"
For SaaS Businesses:
Understand how different user segments interact with your application.
- Dimension Idea:
plan_type(e.g., free_trial, basic, pro) - Question It Answers: "What is the adoption rate of our new feature among 'Pro' users compared to those on a 'Basic' plan?"
- Dimension Idea:
logged_in_status - Question It Answers: "How does the site behavior of logged-in users differ from anonymous visitors?"
Step-by-Step Guide: How to Create a Custom Dimension
Creating a custom dimension is a two-phase process. First, you need to send the custom data to Google Analytics. Second, you must register that parameter in the GA4 interface so it knows what to do with the data. The best way to manage this is using Google Tag Manager (GTM).
Phase 1: Sending Custom Data with Google Tag Manager
Before GA4 can report on a custom dimension, you have to feed it the right information. Let's use a real-world example: tracking the author of a blog post.
Step 1: Get the Data onto Your Website
First, the information you want to track must be available on the page in a way GTM can access it. The most common and reliable method is to have your developers push it to the website's data layer.
The data layer is a JavaScript object that holds information you want to pass to Tag Manager. For our author example, the code snippet on your page might look something like this:
<script>
window.dataLayer = window.dataLayer || [],
window.dataLayer.push({
'authorName': 'Sarah Jennings'
}),
</script>This code should load high on the page, ideally before your GTM container snippet.
Step 2: Create a Data Layer Variable in GTM
Now, you need to teach GTM how to read that authorName information from the data layer.
- Inside your GTM container, navigate to Variables from the left-hand menu.
- Under User-Defined Variables, click New.
- Name your variable something descriptive, like
DLV - authorName. - Click on Variable Configuration and choose Data Layer Variable as the type.
- In the Data Layer Variable Name field, enter the key from your data layer exactly as it appears:
authorName. Matching case is important. - Leave everything else as default and click Save.
Step 3: Attach the Data to Your GA4 Event Tag
Finally, you need to pass this new variable to Google Analytics whenever an event happens. For tracking an author, it makes the most sense to attach it to the page_view event.
- In GTM, navigate to Tags and find your main GA4 Configuration tag or, if you use a separate tag for events, your default GA4 Event - page_view tag. Click to edit it.
- Under Event Parameters, click Add row.
- In the Parameter Name field, give it a clean, descriptive name. Google recommends lowercase and underscores (snake_case). Let's use
author_name. This is the name you will use later in GA4. - In the Value field, click the brick icon and select the GTM variable you just created:
{{DLV - authorName}}. - Click Save on the tag, and then Submit your changes in GTM to publish them live.
Great! You are now successfully sending the author's name to Google Analytics with every page view. But we're not quite done.
Phase 2: Registering the Custom Dimension in Google Analytics 4
Even though GA4 is now receiving your author_name parameter, it doesn't yet know it's a dimension you want to use in reporting. You must register it.
- Log in to your Google Analytics 4 account and navigate to the Admin panel (the gear icon in the bottom-left).
- Make sure you're in the correct Property, then click on Custom definitions under the Data display section.
- Click the big blue button that says Create custom dimensions.
- Now, fill out the configuration form:
- Click Save.
That’s it! Be patient, as it can take 24-48 hours for data from your new custom dimension to populate in standard reports and explorations.
Using Your New Custom Dimension in Reports
Once data starts flowing in, the fun begins. Here’s where to find and use your new Author Name dimension.
Adding it to Standard Reports
You can quickly add custom dimensions as a secondary dimension to most standard reports.
- Go to a relevant report, like Reports > Engagement > Pages and screens.
- This report shows you top pages. To see the author for each page, click the blue + icon to the right of the 'Page path and screen class' dimension column header.
- A search box will appear. Type "Author Name" and you should see it under the CUSTOM heading. Select it.
Your report will now show a new column with the Author Name for each page path, allowing you to quickly see which pages belong to which author.
Building Custom Reports in Explorations
The real power of custom dimensions is unlocked in the Explore section, where you can build completely custom reports.
- In the left-hand navigation, click Explore.
- Start a new Free-form exploration.
- In the Variables column on the left, next to Dimensions, click the + icon.
- Search for and import
Author Name. It will be under theCustomdropdown. Also, importPage path. Hit the blue Import button. - Now, find the
Author Namedimension in your Variables panel and drag it over to the Rows box under Tab Settings. - Next, in the Values box, add metrics like Views and Engagement rate.
Just like that, you have a custom report that shows performance metrics for each individual author, a report that was impossible to create with standard GA4 dimensions alone.
Final Thoughts
Setting up custom dimensions elevates your analysis from generic to specific, turning Google Analytics into a tool that reflects the unique data points of your business. By tracking the information that really matters, you can move past surface-level metrics and start answering the strategic questions that drive growth.
Manually building reports in GA4 Explorations to analyze all your new custom data can still be time-consuming. At Graphed, we help you get to the insights faster. After linking your GA4 account, we allow you to bypass the report builder entirely. You can simply ask questions in plain English, like "Show me a chart of total views by Author Name for last quarter," and instantly get the visualization you need, saving you from the click-heavy process of building explorations from scratch.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
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.