How to set up content groups in Google Analytics 4 using Google Tag Manager
May 13, 2025By Lorna Walker
What are content groups and why do you need them?
If you've ever looked at your Google Analytics and felt overwhelmed by dozens of individual pages, content groups are exactly what you need. Think of them as filing cabinets for your website content – instead of looking at every single page individually, you can group related pages together to see the bigger picture.
For example, if you run a small business website, you might want to group all your:
- Blog posts together
- Product pages together
- Service pages together
- Event listings together
This way, you can quickly see which type of content is performing best without getting lost in the details of individual pages.
Content groups in GA4 work differently than they did in the old Universal Analytics (which stopped working in July 2024). The good news is that the new method is actually more flexible once you understand it.
Key benefits of content groups for small businesses
Save time on analysis
Instead of scrolling through hundreds of individual pages, you'll instantly see which sections of your website are working hardest for your business.
Make better content decisions
Quickly identify whether your blog posts drive more engagement than your product pages, or whether your service pages need more attention.
Understand your customers better
See how people move between different types of content on your website, helping you improve their journey.
Focus your limited time and budget
When you're managing everything yourself, content groups help you prioritise which areas of your website need the most attention.
Before you start: what you'll need
Before setting up content groups, make sure you have:
- Google Analytics 4 already set up on your website (not the old Universal Analytics)
- Google Tag Manager installed on your website
- Admin access to both your GA4 and GTM accounts
- A clear idea of how you want to group your content (we'll help you plan this)
In this blog we'll be showing you how to set up content groups using regex tables.
- Best for: Small business owners who want to get started quickly
- Requires: No developer or coding knowledge
- How it works: Looks at your website URLs to automatically group pages
- Limitation: If you change your website structure or URLs, you might need to update it
Don't let the word "regex" scare you – it's just a way of telling Google Tag Manager to look for certain patterns in your website URLs. For example, you might be teaching Google to recognise that any page with "/blog/" in the URL should be counted as a blog post.
Planning your content groups
Before we dive into the technical setup, take a moment to plan how you want to group your content. Look at your website and consider patterns in your URLs:
Common patterns for small businesses:
- Blog posts:
/blog/ - Services:
/services/ - Products:
/products/or/shop/ - About pages:
/about/ - Contact pages:
/contact/ - Events:
/events/
Write down what patterns your website uses – we'll need these in the next step.
Step-by-step setup guide
Step 1: Create a new variable in Google Tag Manager
- Log in to your Google Tag Manager account
- Select the container for your website
- Click on "Variables" in the left-hand menu
- Scroll down to "User-Defined Variables"
- Click the "New" button
Step 2: Configure your content group variable
- Click on "Variable Configuration"
- Choose "Regex Table" from the list of variable types
- Give your variable a clear name like "Content Group" (you'll see this name later, so make it obvious)
- For "Input Variable", select "Page Path" from the dropdown
Step 3: Set up your content group rules
Now you're going to tell Google Tag Manager how to recognise different types of content based on your URL patterns.
For each content group you want to create:
- Click "Add Row" in the RegEx Table section
- In the "Pattern" field, enter the URL pattern (like
blog) - In the "Output" field, enter what you want to call this group (like
Blog Posts) - Repeat for each content type
Example setup:
- Pattern:
blog→ Output:Blog Posts - Pattern:
services→ Output:Services - Pattern:
products→ Output:Products - Pattern:
about→ Output:About Pages
Step 4: Set a default value
Tick the "Set Default Value" checkbox and enter something like "Other Pages" – this catches any pages that don't match your patterns.
Step 5: Configure advanced settings
- In Advanced Settings, make sure "Ignore Case" is ticked (this means it will work whether your URLs have capital letters or not)
- Leave "Full Matches Only" unticked
- Leave "Enable Capture Groups and Replace Functionality" unticked
- Click "Save" to save your variable
Step 6: Add the variable to your GA4 configuration tag
- Click on "Tags" in the left menu
- Find your "Google Analytics: GA4 Configuration" tag and click on it
- Look for a section called "Fields to Set" or "Parameters"
- Click "Add Row" or "Add Parameter"
- For "Field Name" or "Parameter Name", enter exactly:
content_group1 - For "Value", click the variable icon and select your "Content Group" variable
- Save the tag
Important: Make sure you type content_group1 exactly as shown – GA4 is very particular about this.
Testing your setup works properly
Before we make this live, let's test it works. This is crucial – you don't want to discover problems weeks later when you're trying to analyse your data.
Step 1: Use GTM preview mode
- In Google Tag Manager, click the "Preview" button in the top right
- Enter your website URL in the box that appears
- Click "Connect" – this opens a new tab with your website
Step 2: Check your variables
- Navigate to different pages on your website (blog posts, service pages, etc.)
- In the GTM preview panel, click on "Variables"
- Look for your "Content Group" variable and check it shows the right value for each page type
For example, if you're on a blog post, it should show "Blog Posts". If you're on a service page, it should show "Services".
Step 3: Check your GA4 tag is firing
- In the preview panel, click on "Tags"
- Make sure your GA4 Configuration tag shows as "Fired"
- Click on the tag to see its details and confirm the content_group1 parameter is being sent
Step 4: Double-check with GA4 DebugView
- Log in to your Google Analytics 4 account
- Go to Admin → Data Display → DebugView
- You should see your website activity appearing in real-time
- Click on any event and look for the content_group1 parameter in the event details
If everything looks good, go back to GTM and click "Stop Debugging" to exit preview mode.
Step 5: Publish your changes
- In GTM, click "Submit" in the top right
- Add a clear description like "Added content groups for GA4"
- Click "Publish"
Important: It takes 24-48 hours for data to start appearing in your GA4 reports, so don't panic if you don't see content group data immediately.
Where to find your content group data in GA4
After waiting 24-48 hours for data to collect, here's how to see your content groups in action:
In the standard reports
- Go to Reports → Engagement → Pages and screens
- Click the dropdown next to the page title column
- Select "Content group 1" from the list
- Your data will now be grouped by content type instead of individual pages
In explorations (for deeper analysis)
- Go to Explore in the left menu
- Create a new exploration or edit an existing one
- In the left panel under Dimensions, find "Content group 1"
- Drag it to your report to analyse content group performance
You can now see metrics like pageviews, engagement rate, and conversion rate by content group rather than individual pages.
Common problems and how to fix them
I can't see content group data in GA4
- Wait longer: Data can take 24-48 hours to appear
- Check your variable: Make sure the field name is exactly
content_group1 - Test in preview mode: Ensure your variable is returning values
- Check your tag: Confirm your GA4 tag is firing properly
My content groups are showing "Other" for everything
- Check your patterns: Your regex patterns might be too specific
- Test individual pages: Use preview mode to see what your variable returns for each page type
- Simplify patterns: Try using simpler patterns like just
bloginstead of/blog/
Some pages are in the wrong group
- Order matters: GTM uses the first matching pattern, so put specific patterns before general ones
- Check for overlaps: Make sure your patterns don't accidentally catch the wrong pages
Data stopped working after changing my website
- URL changes: If you changed your URL structure, update your regex patterns
- Consider upgrading: This is a good time to switch to the data layer method
Best practices for maintaining your content groups
Keep it simple
Start with 3-5 main content groups. You can always add more later, but too many groups make analysis confusing.
Use clear, consistent naming
Use names that everyone in your team will understand. "Blog Posts" is better than "Content Type A".
Document your setup
Keep notes about which patterns you used and why. Future you (or your team) will thank you.
Review regularly
Check your content groups monthly to ensure they're still working correctly, especially if you've added new sections to your website.
Consider multiple content groups
You can set up multiple content group levels (content_group1, content_group2, etc.) for more detailed analysis. For example:
- Content Group 1: Blog Posts, Services, Products
- Content Group 2: Beginner Guides, Advanced Tutorials, Case Studies
Align with business goals
Group content in ways that help you make business decisions. If you want to know whether educational content drives sales, group it accordingly.
Next steps to improve your analytics
Now that you have content groups set up, here are some ways to get even more value from your analytics:
Set up goal tracking
Create events in GA4 to track important actions like form submissions, downloads, or purchases. Then see which content groups drive the most valuable actions.
Create custom audiences
Use your content groups to create audiences of people who engage with specific content types. You can then use these for remarketing or to understand different user segments.
Monitor content performance over time
Use GA4's comparison features to see how different content groups perform month-over-month or year-over-year.
Integrate with Google Search Console
Connect your GA4 with Google Search Console to see which search terms drive traffic to different content groups.
Consider upgrading your setup
If you started with the regex method, consider upgrading to the data layer method when you next work with a developer. It's more reliable long-term.
Explore GA4's exploration reports
Use GA4's exploration features to create custom reports that combine content groups with other dimensions like traffic source or device type.
Summary
Content groups transform overwhelming page-level data into actionable insights by categorising your website content into meaningful groups. While the setup might seem technical at first, following these step-by-step instructions will have you analysing content performance like a pro.
Remember:
- Test everything in preview mode before publishing
- Wait 24-48 hours for data to appear
- Keep your groups simple and business-focused
- Review and maintain your setup regularly
Content groups are just one piece of the analytics puzzle, but they're a powerful tool for understanding how different types of content contribute to your business goals. Take time to explore the data once it starts flowing – you might discover insights that transform how you think about your website content.
How we can help you
If you'd like to learn more about GA4, take a look at our other GA4 resources, articles and free demo videos. We also run a regular Introduction to Google Analytics using GA4 webinar that you might find helpful if you are just getting started with GA4.
About the author
Lorna has been working in digital marketing for more than 20 years now, both running campaigns for her own businesses as well as working on behalf of clients. She particularly enjoys helping clients learn how to take control of different aspects of their digital marketing themselves, making the best use of the tools that are available to them and getting them out from under reliance on developers and agencies to do things for them, empowering them to do these things themselves.
Struggling to implement these strategies in your own business? You're not alone. Join our training webinars designed specifically for small and medium businesses ready to take their digital marketing to the next level. View our complete list of upcoming topics and training sessions.