Share
Contents
When you upgrade from Universal Analytics to Google Analytics 4, you can be interested in transiting your content grouping from Universal Analytics to content grouping in Google Analytics 4.
However, GA4 doesn’t allow you to set up content groups in the GA4 interface as you could in Universal Analytics, and everything you see in Google Analytics 4 is (not set) data.
Therefore, let’s discuss how to set up content grouping in Google Analytics 4 using Google Tag Manager. But before doing that, let me explain what content grouping is and why you should consider implementing it. Keep in mind that some benefits can blow your mind!
What is a content grouping, and why should you set it up?
Content grouping in Google Analytics 4 allows you to group your website pages or mobile app screens into specific buckets. As a result, you can analyse big websites with thousands of pages more efficiently and quickly.
There are many ways when you can use content grouping for your website. Some of them are listed below.
- A company started to work with a few agencies to improve their organic position on Google Search. To track the performance of these agencies and compare themselves, a company decided to use content grouping to differentiate articles written by the first and second agencies.
- An ecommerce company that sells clothes has multiple sections on the website; some are for him, and some are for her. The company can use content grouping to track the performance of two sets of pages separately. Apart from that, the company can use the second content group to track jeans, t-shirts, and jackets inside the first content group. For instance, they can compare how successfully jeans are sold to men and women.
- The influencer provides a blog in multiple languages (English, Russian, Polish, Spanish, and German). The same articles but translated into a few languages. To track the performance of the same article written in a few languages, the influencer can set up a content grouping and see the performance of the specific article query over time.
- The listing company can have one listing page and many property pages. To track the funnel easily, they create content grouping and include all property pages in one category.
All of the above are examples of the content grouping in use. If you know other ways of using content grouping for SEO or paid ads, feel free to mention them in the comment section below.
Now that we are on the same page regarding why content grouping is an excellent GA feature let me explain how to add content grouping in Google Analytics 4 using Google Tag Manager.
How to set up a content grouping in Google Analytics 4 using Google Tag Manager
There are at least a few ways to set up the content grouping in GA4 using GTM. Firstly, I will show you how to set it up using a Data Layer for my blog. Secondly, I will show how to do the same with the RegEx tables.
The idea is the same, but you can benefit from the first or the second variant more, depending on your exact goal.
The steps for the two cases to set up GA4 content grouping are almost the same:
- Open GTM and create a new variable
- Select DataLayer Variable or RegEx Table Table Variable Type
- Set up the variable
- Name the variable as “ContentGroup” and save it
- Find the Google Analytics: GA4 Configuration Tag.
- Open the tag and under the “Configuration Parameter” section click on “Add Parameter”
- Write “content_group” to “Configuration Parameter”.
- Select the variable “ContentGroup” you created before for the Value field
- Save the tag
- Check your implementation using GTM Preview mode
- Publish the GTM container
The main difference is the third step. You should set up the variable differently depending on the type of variable you selected in the second step. Let’s talk about it in detail.
Suppose I selected a Data Layer Variable. Since I use the “GTM4WP” WordPress plugin and it fires a data layer with post data for every blog post, I use “pageCategory” as a data layer variable name. In your case, you should ask developers to set up a data layer variable or make it yourself using a plugin or another else.
Suppose I selected a RegEx Table Variable.
I want to track
- every blog post as a post group (examples of page URL: “/blog/post/how-to-get-a-ga4-google-analytics-4-certificate/”, “/blog/post/how-to-import-data-into-google-analytics-4/”)
- every testimonial as a testimonial group (example of page URL: “/blog/testimonial/janos-perczel-polygence/”, “/blog/testimonial/oliver-lindebod-easypractice/”)
- every project as a project group (example of page URL: “/blog/project/how-investorsinproperty-com-improved-the-sign-up-ratio-by-58-optimising-the-website-search/”, “/blog/project/easypractice-analysis-with-73-increase/”)
As you can see above, every page inside the group has the same part of the URL. For blog posts, this is ‘/post/’; for testimonials, this is ‘/testimonial/’ and ‘/project/‘ for projects. Therefore we can use this logic to set up a RegEx table variable in GTM.
To translate this to Google Tag Manager RegEx Table syntax, you should
- select RegEx table variable
- select Page Path as Input Variable
- set default value as others
- in the pattern – output provide:
- .*\/post\/.* – post
- .*\/testimonial\/.* – testimonial
- .*\/project\/.* – projects.
.*\/post\/.* means every page path wherever it includes /post/. The same with testimonial and project pages.
The RegEx Table Variable allows you to set up content grouping in Google Analytics 4 as you did in Universal Analytics using the UA interface.
GA4 Content Grouping Nuances:
- Although GA4 allows creating only one content grouping at the moment, you can set up more content groups using custom dimensions.
- Google Analytics 4 Content grouping data will be sent into BigQuery if BigQuery integration is enabled.
Final Word
Content grouping is an excellent GA4 feature that allows you to analyse your website performance more quickly. You can set up content grouping in Google Analytics 4 via Google Tag Manager using a data layer variable or RegEx table variable. The latest will mean no-code changes and no need for a developer’s help.
Content grouping in Google Analytics 4 allows you to group your website pages or mobile app screens into specific buckets. As a result, you can analyse big websites with thousands of pages more efficiently and quickly.
Step #1: Open GTM and create a new variable.
Step #2: Select DataLayer Variable or RegEx Table Table Variable Type
Step #3: Set up the variable
Step #4: Name the variable as “ContentGroup” and save it
Step #5: Find the Google Analytics: GA4 Configuration Tag.
Step #6: Open the tag and under the “Configuration Parameter” section click on “Add Parameter”
Step #7: Write “content_group” to “Configuration Parameter”.
Step #8: Select the variable “ContentGroup” you created before for the Value field
Step #9: Save the tag
Step #10: Check your implementation using GTM Preview mode
Step #11: Publish the GTM container
You Might Also Like
Written By
Ihar Vakulski
With over 8 years of experience working with SaaS, iGaming, and eCommerce companies, Ihar shares expert insights on building and scaling businesses for sustainable growth and success.
KEEP LEARNING
The desire to learn Google Analytics 4 is growing every day, and it started to grow considerably when Google announced that Universal Analytics was going…
Google announced the sunsetting of Universal Analytics on the 1st of July, 2023. That’s not the best news for companies that use Universal Analytics as…
Leave a Comment
Your email address will not be published. Required fields are marked *
Stay Updated About Every New GA4 Feature
Subscribe to this newsletter to learn more about new Google Analytics 4 features and adjustments.
No SPAM and only relevant content guaranteed!