GA4 Content Grouping: How to Set It Up with Tag Manager

Content grouping means sorting your pages into a logical structure that reflects how you think about your website or app. It is most useful for larger online stores, blogs and content-heavy sites, where looking at thousands of individual URLs tells you nothing.
To set up content groups in GA4, follow the steps below.
Creating a RegEx Table variable in Google Tag Manager
1. Decide on your group names and define exactly which categories and pages each group should contain.
2. Based on those groups, create a RegEx Table in Google Tag Manager that identifies every page belonging to each group.
To do that, open your Google Tag Manager account and go to Variables.
3. Under User-Defined Variables, click New.
4. Click the area labeled Choose a variable type to begin setup…
5. Scroll down and select RegEx Table.
6. Name your table variable, for example Content Group.
7. Click Variable Configuration. You will see a section like the one below:
8. In the Input Variable field, pick {{Page Path}} from the dropdown.
If that variable does not exist yet, create it first so the table has something to read.
Now click + Add Row…
…enter your input pattern and output value, then click + Add Row again.
Example input pattern: cocktail|evening|a-line|wrap
Example output value: Dresses
If the page path contains any of the words in the input pattern, that page is assigned to the output group.
The ‘|’ symbol works as an OR operator.
9. Enter the remaining input patterns and their output values, for example:
Example input pattern: flared|tulle|denim|leather
Example output value: Skirts
Example input pattern: skinny|joggers|cigarette|boyfriend
Example output value: Pants
10. Check Set Default Value and enter Other in the Default Value field. This way, any page whose path does not match any input pattern lands in a group called Other.
11. Under Advanced Settings:
- leave Ignore Case checked (so the table matches regardless of letter case)
- uncheck Full Matches Only (so the table performs partial matches)
- uncheck Enable Capture Groups and Replace Functionality (Google recommends against using it when Full Matches Only is off)
12. Click Save in the top right corner to save the table variable.
Editing the GA4 configuration tag in Google Tag Manager
1. In Google Tag Manager, go to Tags and click the name of your GA4 configuration tag.
2. Click Tag Configuration.
3. Expand Fields to Set and click Add Row.
4. Enter content_group in the Field Name box and {{Content Group}} in the Value box.
{{Content Group}} refers to the table variable you created earlier.
5. Click Save to apply the change.
Checking content group data in Google Analytics 4
1. Wait 24 hours after creating the group before checking the data.
Then go to Reports → Engagement → Pages and screens.
2. Scroll down to the data table and click the Page title and screen class dropdown.
3. Select Content group.
The report now shows data broken down by your content groups.
Content groups only make sense when the structure mirrors how your customers actually buy. If the reports show data you cannot act on, the problem is usually the configuration, not the tool. That is one of the things we check in a marketing audit.




















