How to Create Content Groups in Google Analytics
Organizing your Google Analytics by page title or URL only tells you half the story. To truly understand performance, you need to see which types of content are hitting the mark. This is where Content Groups come in, allowing you to bundle pages into logical categories for high-level analysis. This tutorial will walk you through, step-by-step, how to set up and use Content Groups in Google Analytics 4.
What Are Content Groups in Google Analytics?
Content Groups let you create logical collections of your content based on your site's structure. Instead of analyzing hundreds of individual page URLs, you can group them into categories that make sense for your business, such as "Blog," "Product Pages," "Case Studies," or even by specific product lines like "Men's Apparel" and "Women's Footwear."
Think of it like organizing a massive library. Analyzing every single book title would be overwhelming. It’s far more insightful to first organize the books by genre - Fiction, Biography, Science, etc. - to see which sections are most popular. Content Groups do the same for your website, transforming a long list of pages like:
/blog/10-tips-for-better-seo/blog/guide-to-keyword-research/products/running-shoe-model-x/products/training-shirt-model-y
Into clean, high-level groups like:
- SEO Blog
- Product Pages
This approach helps you answer critical questions that individual page reports can't, like: "Are our blog posts or product pages driving more conversions?" or "Which blog category generates the most user engagement?" It shifts your focus from the performance of individual assets to the performance of your overall content strategy.
Content Groups in GA4 vs. Universal Analytics
If you're familiar with Universal Analytics (UA), you might remember Content Groupings as a built-in feature in the Admin panel where you could define rules directly in the interface. Google Analytics 4 takes a more flexible, but also more technical, approach. It doesn't have a dedicated "Content Grouping" section in the Admin settings anymore.
Instead, in GA4, you must configure Content Groups by sending a custom event parameter called content_group along with your events (like page_view). The most common and powerful way to do this is using Google Tag Manager (GTM). While this requires a few more upfront steps, it gives you far more control and accuracy in how you define your groups. This guide will focus on the modern GA4 method using GTM.
How to Set Up Content Groups in GA4 (The GTM Method)
Setting up effective Content Groups in GA4 is a five-step process that moves between planning, Google Tag Manager, and Google Analytics. Let's walk through it together.
Step 1: Define Your Content Group Logic
Before you touch any tool, you need a plan. How do you want to categorize your website's content? The right structure depends entirely on your business model and what you want to measure. Sketch out your site's main sections and decide on the labels you'll use.
Here are a few common ways to structure content groups:
- By Site Section: This is a great starting point for most websites. For example: Homepage, Blog, Products, About Us, Contact.
- By Blog Category: If your blog is a major traffic driver, get more specific. For example: SEO Posts, Content Marketing, Social Media Marketing, PPC Guides. You can typically base this on clues in the URL structure, like
/blog/seo/. - By Product Category (for E-commerce): Group pages based on what you sell. For example: Shirts, Pants, Shoes, Accessories.
- By Funnel Stage: If your content is mapped to a buyer's journey. For example: Awareness (Guides, Blog Posts), Consideration (Case Studies, Comparisons), Conversion (Pricing Page, Contact).
Decide on a structure and write it down. For this tutorial, we'll imagine we run a blog and want to group content into categories like "SEO," "CRO," and "Email Marketing" based on the URL.
Step 2: Create a 'Regex Table' Variable in GTM
Once you have your logic, it's time to build a variable in Google Tag Manager that will automatically label each page view. The "Regex Table" variable is perfect for this. It looks at the page's URL and, based on rules you set, returns the correct content group name.
- In your GTM container, navigate to Variables from the left-hand menu.
- Under "User-Defined Variables," click New.
- Name your variable something descriptive, like "GA4 - Content Group Variable."
- Click Variable Configuration and choose Regex Table as the variable type.
- For the Input Variable, select
{{Page Path}}. This tells GTM to analyze the part of the URL that comes after the domain (e.g., /blog/seo/my-post). - Now it's time to build the "table." Click + Add Row under "Pattern / Output". This is where you'll translate your URL structures into group names. The Pattern field uses Regular Expressions (Regex) to find pages, and Output is the name you want to assign.
Here’s an example based on our imagined blog:
- Pattern:
^/blog/seo/.*| Output:SEO Blog - Pattern:
^/blog/cro/.*| Output:CRO Blog - Pattern:
^/blog/email-marketing/.*| Output:Email Marketing Blog - Pattern:
^/products/.*| Output:Product Pages
Quick Regex Tip: ^ means "starts with," and .* means "followed by any character." So, ^/blog/seo/.* matches any URL that starts with /blog/seo/. This is often all you need for simple content grouping.
- Below the table, check the box for Set Default Value and enter a value like "Other" or "Uncategorized". This ensures any pages that don't match your rules still get labeled.
- Leave the other advanced settings as they are and click Save.
You’ve just built an automated sorter for your content!
Step 3: Update Your GA4 Configuration Tag
Now, you need to send your new variable to Google Analytics. You do this by adding it as a parameter to your main GA4 Configuration tag.
- In GTM, navigate to Tags.
- Find and click on your primary GA4 configuration tag. It’s usually named something like "GA4 Config - [Your Measurement ID]".
- Click Tag Configuration. Under the Event Parameters section, click Add Row.
- In the Parameter Name field, type exactly:
content_group. This exact name is required for GA4 to recognize it. - In the Value field, click the lego brick icon and select the Regex Table variable you just created (e.g.,
{{GA4 - Content Group Variable}}). - Click Save to update your tag.
This tells GTM that every time a page loads, it should run your logic from the Regex Table and send the result to GA4 with the label content_group.
Step 4: Register content_group as a Custom Dimension in GA4
Just because you're sending the data doesn't mean GA4 knows what to do with it yet. The final setup step is to tell GA4 that content_group is a piece of information you want to use in a report. This is called registering a custom dimension.
- Navigate to your Google Analytics 4 property.
- Click the Admin gear icon in the bottom-left.
- In the "Data display" column, click on Custom definitions.
- Click the blue Create custom dimensions button.
- Fill in the fields as follows:
- Click Save.
That's it! Be patient, as it can take up to 48 hours for data from new custom dimensions to appear in your reports.
Step 5: Test and Preview Your Setup in GTM
Never publish without testing. GTM's Preview mode is your best friend here.
- In your GTM workspace, click the Preview button in the top right.
- A new browser tab will open. Enter your website's URL and click "Connect."
- Your website will open in another tab, with the GTM debugger "connected." Navigate to a few pages that should belong to different content groups.
- In the debugger window, click on an event like "Container Loaded" in the left-hand navigation.
- Click on your GA4 Configuration Tag to see its details.
- Look at the Event Parameters being sent. You should see
content_grouplisted, along with the correct value (e.g.,SEO Blog) for the page you're on. - Verify this for a page from another category to ensure your Regex logic is working correctly.
Once everything looks good, go back to GTM, click Submit, and publish your container.
How to View and Use Your Content Group Reports in GA4
Once data starts flowing, you can use your "Content Group" dimension in GA4's Exploration reports to build powerful analyses.
Here's how to build a basic report:
- In GA4, go to Explore on the left menu.
- Click to start a Blank new exploration.
- In the "Variables" column, click the + icon next to "Dimensions."
- Search for Content Group, check the box, and click Import.
- In the same column, click the + next to "Metrics" and import the metrics you care about, like Sessions, Engaged sessions, Conversions, and Total users.
- Drag your Content Group dimension from the Variables list into the Rows section of the "Tab Settings."
- Drag your chosen metrics into the Values section.
Instantly, you'll see a table showing the performance of each content category. This view makes it easy to spot trends - like your "SEO Blog" driving the most sessions but your "Product Pages" having a higher conversion rate.
Quick Guide: Setting Up Content Groupings in Universal Analytics (GA3)
Universal Analytics has been deprecated, but many businesses still have historical data they look at. The setup process in UA was quite different and happened entirely within the GA interface.
You could find it under Admin > View > Content Grouping. From there, you could click "New Content Grouping" and create groups using one of three methods:
- Rule-Based Grouping: The most common method, where you created rules like "Page path contains /blog/seo/" to assign content to a group. This was similar to the Regex table functionality but resided within GA itself.
- Extraction-Based Grouping: You could use Regex to pull a group name directly from a page's URL or title. This was useful for sites with highly consistent URL structures.
- Tracking Code-Based Grouping: The most manual method, requiring developers to add a small line of code to each page to define its group, like:
ga('set', 'contentGroup1', 'SEO Blog'),.
While the methodology has changed in GA4, the strategic goal remains the same: to organize your website into a structure that reflects your business goals.
Final Thoughts
Setting up Content Groups in GA4 helps you zoom out from analyzing single pages and gives you a strategic overview of your entire content ecosystem. By understanding which themes and topics resonate most with your audience, you can make smarter decisions about where to invest your energy and budget.
We know that navigating between Google Tag Manager and GA4, waiting for data, and building custom reports can be a bit of a maze. At Graphed, we aim to simplify that whole process. Once connected to your Google Analytics account, you can skip the manual setup and just ask, "What were my top performing content groups last month?" Our AI analyst then builds the charts and finds the insights for you, turning hours of technical work into a simple, 30-second conversation.
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.