How to set up Content Grouping in Google Analytics 4

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.  

GA4-Content-Grouping-Report-Showing-Not-Set-Values
GA4 Content Grouping Report showing (not set)

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.

GTM Tag updates to send Content Groups into Google Analytics 4
Updated Google Tag in GTM to send Content Groups into Google Analytics 4

The steps for the two cases to set up GA4 content grouping are almost the same:

  1. Open GTM and create a new variable

  2. Select DataLayer Variable or RegEx Table Table Variable Type

  3. Set up the variable

  4. Name the variable as “ContentGroup”  and save it

  5. Find the Google Analytics: GA4 Configuration Tag. 

  6. Open the tag and under the “Configuration Parameter” section click on “Add Parameter”

  7. Write “content_group” to “Configuration Parameter”.

  8. Select the variable “ContentGroup” you created before for the Value field

  9. Save the tag

  10. Check your implementation using GTM Preview mode

  11. 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.

GTM-Preview-Showing-Page-Category-Data-Layer-Variable
GTM4WP Plugin Sends pageCategory Data Layer Variable

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.

RegEx Table GTM Variable to send content groups data into GA4
RegEx Table GTM Variable to send content groups data into GA4

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 

  1. select RegEx table variable
  2. select Page Path as Input Variable 
  3. set default value as others
  4. in the pattern – output  provide:
    1. .*\/post\/.*  – post
    2. .*\/testimonial\/.* – testimonial
    3. .*\/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. 


What is a content group in Google Analytics 4?

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.

How do I create a content group in Google Analytics 4?

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

2 Replies to “How to set up Content Grouping in Google Analytics 4”

  1. Please help – I’ve been trying to set up content groups, and I can’t follow yours or anyone else’s instructions, because there is no longer a GA4 Configuration Tag. As one user states: “In early September 2023, Google retired the Google Analytics 4 configuration tag. It is now replaced by a new tag template called Google Tag. ” And the problem with that is there is no longer the ability to do Step 6 above: Open the tag and under the “Fields to Set” section click on “Add Row”.

    I’ve been going in circles trying to find another way to get this done, but still GA4 says all my content groups are “not set”.

    1. Hi Nancy,

      Thank you for reaching out.

      I’ve updated the blog post with the new screenshots that show how to set up GA4 content grouping using Google Tag in GTM.

      Let me know if you have any other questions; don’t hesitate to subscribe to my newsletter as well.

      Best regards,
      Ihar

Leave a comment

Your email address will not be published. Required fields are marked *