How to set up a new content group in Google Analytics 4 using Google Tag Manager

This video shows you how to set up a new content group in Google Analytics 4 using Google Tag Manager. Content groups are useful when you want to be able to see the analytics for particular types of content on your website. For example, you might want to analyse traffic to all your blog posts separately from the rest of your website, or all your event listings or some other group of content that is useful to you. The process for doing this is different in GA4 than it was in Universal Analytics and requires you to be using Google Tag Manager. This video shows you what to do, and there are also written instructions below the video.

How to set up a content group in Google Analytics 4 using Google Tag Manager

  1. Access your Google Tag Manager account and navigate to the container for the website you want to work on.
  2. Create a new variable by clicking on “Variables” and scrolling down to “User Defined Variables.” Select “New” to create a new variable.
  3. Give your new variable the name “Content Group,” and choose the variable type “Regex Table.”
  4. Select the Input Variable to be “Page Path”
  5. Configure the regex table by adding rows for each content group you want to track. Enter the pattern you want to search for in the URL, such as “event” or “blog,” and specify the corresponding output that will appear in Google Analytics.
  6. Set a default value for “other” to cover pages that don’t fall into any specific content group.
  7. Configure advanced settings – keep “ignore case” checked and enable “Capture Groups” and “Replace” functionality.
  8. Save the variable configuration.
  9. Add the newly created variable to your Google Analytics configuration tag. Click on “Tags,” locate the Google Analytics configuration tag, and click on it.
  10. In the tag configuration, add a new field by clicking on “Field Name” and enter “content_group” as the name. Use double curly brackets to pull the value from the “content group” variable.
  11. Save the tag configuration.
  12. Preview the changes by clicking on “Preview” and enter a URL from your website that is in the content group you’ve created to test if the content grouping is working as expected.
  13. Check the variables to ensure the “Content Group” variable returns the appropriate value for the URL.
  14. Stop debugging and return to the Tag Manager.
  15. When you’re satisfied with the changes, click on “Submit” to apply them.
  16. Provide a title and description for the changes and click “Publish” to make them live.
  17. Wait for 24 hours to allow data to be collected in Google Analytics.
  18. Access your Google Analytics account and navigate to the relevant property.
  19. In the engagement dropdown, select “Pages and Screens” to view the reports.
  20. Expand the dropdown menu for content listing and select “Content Group” as an additional dimension.
  21. Review the pageviews and other metrics according to the different content groups you set up in Tag Manager.

Remember, these steps provide a general overview of the process. Detailed configurations and specific settings may vary based on your specific requirements and setup.

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.

Scroll to Top