What is the advantage of using content grouping in GA4?
Through content grouping in GA4, you can quickly check the performance of a content group or compare the performance of different content groups with each other.
Content groups allow you to measure the performance of a set of web pages at the content category or product category level.
Content grouping is especially useful if you have got a big website with hundreds or thousands of web pages and you can realistically measure the web pages performance, only at the group level and not at the individual page level.
How to create content grouping in Google Analytics 4
Follow the steps below:
Step-1: Decide the names and number of content/product categories which you will use as ‘content groups’ in your GA4 property.
Let us suppose, you have decided to create the following content groups in GA4:
Attribution Modelling
Google Tag Manager
Google Analytics
Facebook
Other
The content group ‘Other’ contains the web pages that do not belong to any of the following content groups:
Attribution Modelling
Google Tag Manager
Google Analytics
Facebook
Step-2: Identify all of the web pages which will be part of each content group. You can use regular expressions to identify all such pages.
For example:
In order to identify all the web pages on my website that belong to the ‘Attribution Modelling’ content group, I can use the following regular expression:
attribution|model|online|offline|nonline
In order to identify all the web pages on my website that belong to the ‘Google Tag Manager’ content group, I can use the following regular expression:
google-tag-manager
In order to identify all the web pages on my website that belong to the ‘Google Analytics’ content group, I can use the following regular expression:
google-analytics
Similarly, in order to identify all the web pages on my website that belong to the ‘Facebook’ content group, I can use the following regular expression:
facebook
Step-3: Based on the logic you developed in step-2, create a new Regex Table variable in GTM that can identify all of the web pages which will be part of each ‘content group’.
Follow the steps below:
#3.1 Login to your GTM account and then click on the ‘Variables’ tab:
#3.2 Click on the ‘New’ button next to ‘User Defined Variable’:
#3.3 Click on ‘Choose a variable type to begin setup’:
#3.4 Scroll down and then click on the ‘Regex Table’:
#3.5 Enter a name for your Regex table variable. You will later reference the variable by this name. Let’s name the regex table variable as ‘Content Group’:
#3.6 Click on ‘Input Variable’:
You should now see a screen like the one below:
#3.7 Select ‘{{Page Path}}’ as the Input variable from the drop-down menu:
Note: If your input variable does not already exist then you would need to create a new one. You need an input variable in order to use a regex table variable.
#3.8 Click on the ‘+Add Row’ button:
#3.9 Enter your input pattern and their corresponding output value in the first row and then click on the ‘+Add Row’ button:
From the screenshot above we can conclude the following:
If ‘page path’ contains any of the following words then make the corresponding web page, part of the ‘Attribution Modelling’ content group:
attribution
model
online
offline
nonline
Note: The pipe symbol (|) separating the two words corresponds to the Logical OR operation.
#3.10 Enter your other input patterns and their corresponding output values in the regex table, row by row, from top to bottom like the one below:
#3.11 Click on the ‘Set Default Value’ checkbox and then type ‘Other‘ in the default value text box:
This is what I am doing here:
If a ‘page path’ does not match any of the specified input patterns then make the corresponding web page part of the ‘Other’ content group.
#3.12 Under ‘Advanced Settings’ uncheck the following two checkboxes:
Full Matches Only
Enable Capture Groups and Replace Functionality
I unchecked the ‘Full Matches Only‘ checkbox because I want the regex table variable to do a partial match.
I unchecked the ‘Enable Capture Groups and Replace Functionality‘ checkbox because Google recommends not to use ‘Enable Capture Groups and Replace Functionality‘ if the ‘Full Matches Only’ checkbox is unchecked.
I want the regex table variable to do a case insensitive match. That’s why I did not uncheck the ‘Ignore Case’ checkbox.
#3.13 Click on the ‘Save’ button on the top right-hand side to save the new regex table variable:
Now we are to going to edit the GA4 configuration tag. It is the tag that is used to install GA4 on a website.
Step-4: Click on the ‘Tags’ tab and then click on the name of your GA4 configuration tag:
Step-5: Click on the ‘Tag Configuration’ box:
Step-6: Click on the ‘Fields to set’ drop-down menu:
Step-7: Click on the ‘Add Row’ button:
Step-8: Type ‘content_group’ in the ‘Field Name’ text box and type ‘{{Content Group}}’ in the ‘Value’ text box:
Note: ‘{{Content Group}}’ is the regex table variable we created earlier.
Step-9: Click on the ‘Save’ button to save your updated GA4 configuration tag:
Now we are going to test our new regex table variable to see whether it works the way it is supposed to work.
Step-10: Click on the ‘Preview’ button on the top right-hand side of your GTM account to put your container in preview mode:
Step-11: Enter the URL of an article page on your website and then click on the ‘Connect’ button:
As soon as you click on the ‘Connect’ button you would be redirected to the article page on your website.
Step-12: Navigate back to the Tag Assistant window and then click on the ‘Continue’ button:
Step-13: Click on ‘Consent Initialization’ and then click on the ‘Variables’ tab:
Step-14: Scroll down until you find the ‘Content Group’ variable and then check its value:
From the screenshot above we can conclude that the value of the ‘content group’ variable is ‘Attribution Modelling’ which is correct. Because the URL of the article that I entered earlier is related to attribution modelling.
Step-15: Once you are satisfied with the results then click on the cross button on the top left-hand corner to close the Google Tag Assistant:
Step-16: Click on the ‘Stop debugging’ button:
Step-17: Navigate back to your GTM account and then click on the ‘Preview’ button.
Step-18: Repeat steps 11 to 17 to test other articles on your website and see what value is populated for the ‘content group’ variable in the Tag Assistant window.
You should now be able to see the value of your content group:
This proves that the value of the ‘content_group’ parameter are being passed to GA4.
Step-21: Navigate back to your GTM account and then click on the ‘Submit’ button:
Step-22: Name your version and then click on the ‘Publish’ button to publish the container.
That’s how you can create content groups in GA4.
Note (1): You cannot create content groups retroactively in GA4. The content groups that you create show data only from the date they were first created and going forward.
Note (2): You can include the same web page in multiple content groups.
Where can you see content groups in Google Analytics 4?
Once 24 hours have elapsed from the time you first set up content groups via GTM then follow the steps below to see content group data in GA4:
Step-1: Navigate to the ‘Pages and Screens’ report (under ‘Engagement’) in GA4:
Step-2: Scroll down to the data table and then click on the dimensions drop-down menu:
Step-3: Click on ‘Content Group’:
You should now be able to see the content group data in GA4:
The other place where you can see the content group data in GA4 is in the exploration report.
You just need to find and import the ‘Content group’ dimension:
Note: When there is no content group data available, GA4 populates the content group dimension with (not set).
Content grouping in GA4 for mobile app
If you want to set up content grouping in GA4 for a mobile app then instead of sending the ‘content_group’ parameter with the pageview event (like we do in the case of a website) send the ‘content_group’ parameter with the ‘screen_view’ event.
Registering the ‘content_group’ parameter as a custom dimension
When you register the ‘content_group’ event parameter as a custom dimension, it appears as a new data card in every event report where you (or GA4) are passing the ‘content_group’ parameter along with the event.
Thus the use of custom dimensions enriches your existing event reports.
To register the ‘content_group’ event parameter as a custom dimension follow the steps below:
Step-1: In your GA4 property navigate to ‘Custom definitions’ under the ‘Configure’ tab:
Step-2: Click on the ‘Create custom dimensions’ button:
Step-3: Create a custom dimension with the following configuration and then click on the ‘Save’ button:
Step-4: After 24 hrs have elapsed, navigate to the ‘Events’ report (under ‘Engagement’):
Step-5: Scroll down to the data table and then click on ‘page_view’ event:
Step-6: Scroll down your screen until you see the data card named ‘content_group’:
Google Analytics 4 Content Grouping - Create Content Groups in GA4 50
Other articles related to GA4 (Google Analytics 4)
"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."
Here’s what we’re going to cover in this training…
#1 Why digital analytics is the key to online business success.
#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.
#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.
#4 Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.
#5 The number 1 reason why conversion optimization is not working for your business.
#6 How to advertise on any marketing platform for FREE with an unlimited budget.
#7 How to learn and master digital analytics and conversion optimization in record time.
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.
About the Author
Himanshu Sharma
Founder, OptimizeSmart.com
Over 15 years of experience in digital analytics and marketing
Author of four best-selling books on digital analytics and conversion optimization
Nominated for Digital Analytics Association Awards for Excellence
Runs one of the most popular blogs in the world on digital analytics
Consultant to countless small and big businesses over the decade
Learn and Master Google Analytics 4 (GA4) - 126 pages ebook
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.