GA4 Content Groups in Google Tag Manager: Setup and Fixes

GA4 content groups let you analyse related pages together instead of working through hundreds of individual URLs. A publisher might group pages by topic; an ecommerce site might compare product, category and support content; a lead-generation site might compare service pages with guides and case studies.

The implementation is simple when the grouping logic is planned first. Most problems I see come from an incomplete lookup table, a parameter that is not attached to the page view, or testing the report before GA4 has processed the data.

What a GA4 content group does

The built-in content_group parameter assigns each page or screen to a label such as “Services”, “Blog”, “Case studies” or “Support”. You can then use the Content group dimension in the Pages and screens report or in an Exploration.

Google’s current content-group documentation recommends using a RegEx Table variable in Google Tag Manager for websites whose groups can be inferred from the URL. That is usually the most maintainable approach.

Plan the grouping before opening GTM

Start with a short, mutually exclusive list. A practical first version might be:

  • Home
  • Services
  • Case studies
  • Blog
  • Tools
  • Contact and company pages
  • Other

Every important page should resolve to one value. Keep the labels stable because changing “Blog” to “Articles” later splits the data into two dimension values. Do not make the first hierarchy too granular; you can add a second custom grouping later if the business question justifies it.

Set up content_group in Google Tag Manager

1. Create a RegEx Table variable

In GTM, go to Variables, create a new user-defined variable and choose RegEx Table. Use {{Page Path}} as the input. Add your path patterns from most specific to least specific.

Page-path patternOutput
^/$Home
^/pricing/|^/services/Services
^/case-studies/Case studies
^/blog/|^/category/Blog
^/tools/Tools

Set a default value such as “Other”. For the common partial-path patterns above, clear “Full Matches Only”. Test the expressions against real URLs, including trailing slashes and any language or regional prefixes.

2. Add the parameter to the Google tag

Open the Google tag that supplies your GA4 measurement ID. Add a configuration parameter named content_group and set its value to your new RegEx Table variable, for example {{Content Group}}. If your container still uses the older GA4 Configuration tag interface, add the same field there.

The important point is that the value must be present when the page-view data is sent. Adding the parameter only to a later event will not reliably categorise the page in the Pages and screens report.

3. Preview before publishing

Use GTM Preview to connect the site to Tag Assistant. Visit one URL from every group, select the page-view event and confirm that the Google tag fired and the resolved value is correct. Google’s Preview and debug guide explains how the browser session and Tag Assistant are connected.

Do not just confirm that the variable has a value in GTM. Check the event or request that is actually sent. This catches cases where the variable works but is attached to the wrong tag.

Why Content group shows “(not set)”

“(not set)” is not one single bug. It means GA4 did not receive a usable group value for those rows. Work through these checks in order:

  1. Check the RegEx result. Preview an affected URL and inspect the variable. If it is undefined, fix the pattern order, full-match setting or default value.
  2. Check the page-view event. Confirm that content_group is included on the event sent to the correct GA4 property and web stream.
  3. Check tag timing. If another page-view tag fires first, GA4 may receive an ungrouped view. Remove duplicate configuration/page-view tags and make the implementation consistent.
  4. Check consent behaviour. A consent banner can prevent or alter the initial request. Test both denied and granted states and confirm that the tag resumes correctly after consent.
  5. Allow for processing. Realtime and DebugView are useful for validation, but standard reports are not instantaneous. Compare new data after processing rather than expecting historical rows to be backfilled.
  6. Confirm the reporting dimension. Use the built-in Content group dimension for content_group. Additional parameters such as content_group2 must be registered as event-scoped custom dimensions before they are useful in reporting.

Using more than one content hierarchy

The native dimension is best for your main site-wide grouping. If you also need a second hierarchy—such as service line, funnel stage or editorial topic—send a clearly named custom event parameter and register it as a custom dimension in GA4. Avoid vague names that will be hard to understand in six months.

For example, the native group might be “Blog”, while a custom parameter called content_topic contains “Google Ads”, “GA4” or “SEO”. That structure is easier to maintain than trying to encode two business questions into one label.

A concise QA checklist

  • Every priority URL returns one stable group.
  • A default group catches unmatched pages.
  • The parameter is attached to the page-view-producing Google tag.
  • There is only one intended page view per load.
  • Tag Assistant shows the correct value on representative URLs.
  • The correct GA4 property and stream receive the event.
  • Consent-granted and consent-denied paths have both been tested.
  • The Content group dimension appears in processed reports.

When to get help

If your GTM preview looks right but GA4 still reports “(not set)”, the cause is often duplicate tagging, consent timing or a mismatch between the event being inspected and the event used by the report. I provide independent GA4 consulting and implementation audits that trace the data from the browser through GTM and into the final GA4 report.

Similar Posts

2 Comments

  1. Hi Ben,
    Thanks for this article. I have a problem with my content groups (all based on pageviews). They were all functioning perfectly, but since the beginning of the week the (not set) value is shown to be the highest. It is as though all pageviews are indexed twice – both in the content group and as not set.
    Currently my content group report looks very similar to the last photo in this article – with (not set) holding the highest value in the group, and also an empty line (which is new..looks just like the one in your photo, between 58 and 56) with small values and no indication to any webpage.
    Do you have any clue about this? Is it safe to assume it’s a GA4 bug and hope it will be fixed soon?
    Thanks a lot!

    1. Hi Oran

      If it worked and then didn’t, its probably a bug. Its different to what I was talking about. If you want to book a free 15 minute call, I can have a look for you and give you more advice.

      cheers

      Ben

Leave a Reply

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