Do you know exactly how each of your website sections perform? Content Groupings are very powerful in structuring and analyzing your content performance in a smarter way.
What business are you in? It might be a blog, leadgeneration or ecommerce site. Actually, it doesn’t matter.
Content performance insights and optimization is crucial for every website.
On default, Google Analytics shows you all the different pages that have received at least one pageview in the selected period.
For high traffic websites this report might look like this:
Over 300.000 pages, happy analyzing!
First of all, you need to use the right set of filters or adapt your view settings to remove all the “technical” query parameters in your default content report.
But this doesn’t solve everything.
A website that contains hundreds or maybe thousands or even more unique pages will greatly benefit from setting up content groupings in Google Analytics.
Ccontent groupings can actually be very useful even if you are just starting out with a new blog!
Table of Contents
- Definitions: Content Groupings and Content Groups
- Why to Use Content Groupings
- How to Set Up Content Groupings
- Settings of a Content Group
- Five Content Group Reports in Google Analytics
- Powerful Ways to Apply Content Groupings
- Eight Content Grouping Best Practices
Definitions
Before we go deeper into this material we need to cover the actual definitions first.
Currently you can create five content groupings in Google Analytics.
Within a grouping you can create multiple content groups.
A group is a collection of content. It could be pages in a certain section of your website or screens from a certain part of your app.
A grouping is just a bunch of groups.
Confusing right?
Why to Use Content Groupings
Let’s take a look at the definition of Google:
“Content Grouping lets you group content into a logical structure that reflects how you think about your site or app, and then view and compare aggregated metrics by group name in addition to being able to drill down to the individual URL, page title, or screen name.”
Collecting reliable data and structuring it in a proper way is very important if you want to turn your Google Analytics data into insights and eventually extra profits.
He is one the greatest mind in the Analytics field and emphasized once again that companies need to make better use of their current data instead of collecting more and more data.
And I fully agree here.
Use your current data in a smarter way before you move on to track all this fancy stuff (which you probably don’t use).
Content Grouping is a great example of how to better leverage your current data set.
How to Set Up Content Groupings
Google Analytics offers a couple of ways to set up your content groupings.
One way to do it is via the Google Analytics admin interface. However, it is also possible to set this up via Google Tag Manager.
Please note that content groupings are effective from the date of creation, not retroactively.
Via Google Analytics
In Google Analytics there are three different ways to set up content groupings.
First step is to navigate to the admin interface in Google Analytics and click on content groupings.
Currently you can create up to five content groupings. Within each of those, there is no limit to the number of content groups you can define.
There are three different ways to define content groups in Google Analytics.
1. Group by Tracking Code
The first option is to modify your JavaScript tracking code (good option if you have solid technical knowledge or work closely together with a webdeveloper).You need to dynamically set this up for each of your website content sections that you want to separate from each other.
It depends on your website architecture, but sometimes this is the only option to structure the content groups in your desired way.
2. Group using Extraction
Another option is to work with extractions. You can define your content groups by page or page title (websites) or screen name (apps).
I recommend you to learn about regular expressions if you want to set it up via this method.
A SEO friendly website structure makes it more easy for you to define your content groups.
For example:
- /services/google-analytics-audit
- /services/google-analytics-coaching
- /services/google-analytics-implementation
In this case there is a logical naming structure that allows you to easier group these pages in one Services Content Group.
3. Group using Rule Definitions
I recommend to go for this option if you are not an advanced user of Google Analytics and want to create these content groups by yourself.
It is similar to option two, but more flexible to those who are not familiar with Regular Expressions.
And if you want to work with “negative” matches this grouping method is the way to go!
One again you can do the grouping by page or page title (websites) or screen name (apps).
In addition you can use statements as contains, starts with, ends with, but also does not contain, does not start with etc.
The negative statements can be very useful in my experience.
Sometimes you have defined all your content groups but a few pages are left. You can set up a match on does not contain your other pages and you are good to go!
Via Google Tag Manager
Julian Juenemann does a great job in explaining how to set this up via Google Tag Manager.
If you are familiar with Google Tag Manager and want to set it up via GTM I recommend to watch his video.
Settings of Content Grouping
Here is an example of a content grouping I have set up for a well-known blogger.
Content Group overview:
- Index 1 (four slots are still free)
- Name: Content directory
- 8 Definitions
We defined the content groups in terms of website section.
- Home, About, Contact, Start here, Resources and Work with me are all one page sections.
- Blog page contains archive and author pages.
- Blog post is a collection of all blog posts.
It was easy to define group number one and two. Simply by matching the URL with the corresponding group.
However, if all blog posts reside in the root, it becomes more difficult to make a match.
That’s why I haved applied a “negative” match here.
This is how it looks:In this case I used a negative RegEx to extract the last content section.
Two more things:
- Use Excel and Google Analytics to sum up all pageviews in your content grouping. And compare it to your all content report pageviews in Google Analytics. A higher number of pageviews in Google Analytics will lead to a large (not set) content group in your content grouping. This is something to avoid!
- The rules get processed in the order of your group items. Number one is the first rule that is processed by Google Analytics.
Five Content Group Reports in Google Analytics
There are different reports in Google Analytics where you can access your content groupings.
All Pages
The All Pages report is a good place to start if you want to see which pages are popular on your website.
Step 1: Navigate to Behavior >> Site Content >> All Pages.
Step 2: Select your Content Grouping.
Now you have a more aggregated view on your content performance.
In this case 80% of the pageviews are on blog posts. People spend by far the most time in this section of the website.
Normally you would have to drill down or search to find more information on your contact or about page since they have a relative low volume of traffic.
It’s more easy to put things in perspective now.
Landing Pages
Another great report where you can examine your content performance is the Landing Pages report.
In my opinion this report is very valuable to any organization.
Step 1: Navigate to Behavior >> Site Content >> Landing Pages.
Step 2: Select your Landing Content Group.
A few things to conclude here:
- The evaluated goal is on “Optin Feature Box Clicks”.
- Almost 90% of the traffic lands on a blog post.
- In absolute numbers, the blog posts are responsible for 2/3 of all conversions.
- The “homepage” and “start here” page convert really well.
- The “homepage” converts three times above average if compared to it’s traffic percentage.
In short, you can get a very quick overview of how your landing content groups actually perform.
Navigation Summary
The navigation summary report can be hard to read if you have hundreds or maybe even thousands of pages on your website.
Applying content groupings can be really effective if you want to know how people navigate through different sections on your website.
On default the content is ungrouped in this report:
There are two things you need to do to create a more accurate overview:
Step 1: Change Group pages by to the name of your content grouping.
Step 2: Change Current Selection to one of your content groups, e.g. Blog Post.
This is great information. A few insights on this blog:
- More than 80% of the visitors leave the website on a blog post.
- 7 out of 10 people that view another page go to a blog post.
- 10% continues to the “start here” or “home” page.
- The “resources” page, where a lot of affiliate links are embedded, gets 2% of all clicks of people that continue their journey.
These quick insights are impossible to get from the default settings.
This is another reason why you need to set up content groupings in Google Analytics.
Behavior Flow
The Behavior Flow report isn’t my number one report, but it can be useful in some cases.
It visualizes the path users take from one page or Event to the next.
This report can help you discover what content keeps users engaged with your site. It can also help identify potential content issues.
Navigate to Behavior >> Behavior Flow.
In my example below I followed these steps:
- Navigate to Behavior Flow.
- Select Content directory Content Grouping.
- Change the dimension to Default Channel Grouping.
- Select Organic Search.
It helps me to analyze how people that come to my site via organic search navigate from one section to the other and where they drop off.
Event Pages
There is one last report I want to share with you. It’s the Event Pages report.
Most people view their events in relation to a particular page. However, it is also possible to view your events in relation to specific content sections on your website.
Here is how to do it:
- Navigate to Events >> Pages.
- Select a Content Grouping.
By using secondary dimensions and table filters you can further drill down on your event data to make it more actionable.
I hope these five examples awaken your creativity to work with Content Groupings in Google Analytics.
Powerful Ways to Apply Content Groupings
There are a few more ways to leverage content groupings in Google Analytics.
I like to share six more things you can do with them.
Secondary Dimensions
In the past I wrote an in-depth post on secondary dimensions.
It’s one of the powerful features in Google Analytics to segment your data.
Report example (content grouping as secondary dimension in Country report):
You can analyze and optimize different content clusters in relation to a few metrics and another dimension.
Custom Segments
Custom segments belong to my most used power features of Google Analytics.
I recommend to read this post first if you are new to segments in Google Analytics.
Let’s assume that you want to segment on all sessions where a blog post is visited:
It’s far more easy to use the specific content section via a content grouping than to individually segment on all blog posts.
Custom Reports
As you might know, Custom reports can be really effectively in bringing together your most important metrics and dimensions.
And once again, your can leverage your content groupings here.
You could apply a content grouping or group as a dimension or use it as a filter in your report.
Custom Dashboards
Are you a fan of creating dashboards in Google Analytics?
You might want to check out content groupings and how to leverage them in your dashboards.
It’s a great addition if you want to share more about the content performance with your team.
Custom Tables
Customizing your data tables and drilling down on your data is a very effective strategy.
You can use content groupings as a table filter if you want to analyze the metrics for that specific dimension.
Core Reporting API
Last but not least, the core reporting API.
You can use the Google Analytics API to automatically export data related to content groupings.
Currently there are three dimensions and one metric directly available.
Here is a complete list of the metrics and dimensions in Analytics Reporting API v4.
Eight Content Grouping Best Practices
Make sure to apply the following eight best practices when working with content groupings:
- Start out with defining the objectives of setting up your content groups. On what level do you want to analyze and improve your content performance?
- Define the best method to set up your content groups.
- Set up goal values for each of your goals. This way you can get the most actionable insights from related reports.
- Keep content groups up to date to minimize (not set) as a content group.
- Create logical groups that reflect your different content templates and sections on your website.
- Create one group that involves all content sections at the overall (aggregated) level.
- Set up other groups (you can set up five groups per view) for a deeper analysis on subsections of your main website categories.
- Make sure to set them up in the right order. It’s the same as with filters, the order of the different rules matters to the outcome.
This is it from my side. Many companies don’t leverage content groupings at all and I like to see that change.
What is your experience with Content Grouping in Google Analytics? If you like this article, it would be great if you share it and leave a comment below!
One last thing... Make sure to get my automated Google Analytics 4 Audit Tool. It contains 30 key health checks on the GA4 Setup.
Sonia Pitt says
Very insightful post. Content grouping are very important feature on GA and I was using the same, but here I found more information which will be explored soon. Thanks for the share.
Paul Koks says
I am glad you like the post Sonia. Good luck with exploring Content Grouping in more depth.
george p says
hi Paul,
yr posts are always very insightful and easy to understand for a guy with not much of a technical knowledge but more of a google analytics user, only.
as for content groupings, my question is if these groups can be used retroactively or they are only effective as from the date of creation?
thanks for your fabtastic job!
Paul Koks says
Hi George! Thanks a lot for your comment, I appreciate it. They are only effective from the date of creation. Good feedback, I will add it to the post.
Davis Jones says
Hey Paul this is a great resource! I enjoy following your updates. We’re going to include this in our weekly Brain Boost at the Eazl YouTube channel (see https://www.youtube.com/c/eazlco if you’re interested).
Rock on!
Davis Jones, Product Lead at Eazl
Paul Koks says
Hi Davis,
Thanks a lot for your comment. And your YouTube channel looks great, I am honoured to be included. :-)
Let me know where I can watch the episode.
Thanks,
Paul
Murray says
OK, so I note that you say: “A higher number of pageviews in Google Analytics will lead to a large (not set) content group in your content grouping. This is something to avoid!”
But exactrly HOW do we avoid it?
Paul Koks says
Thank you for your comment Murray. You can avoid a (not set) content group from appearing by defining groups for all of your pages. If a page doesn’t fall in a certain bucket, it will appear under (not set). You could use a tool like “Screaming Frog” to crawl your entire website (structure) to minize the pageviews in the (not set) group. Hope this helps! PS: I don’t want my (not set) group to be larger than 1 – 2% of my total pageviews.
Johny says
Hey Paul,
great article. My doubt about (not set) is that I use three groups:
Group A, Group B and Group C
In A, B and C I have many subgroups.
These subgroups only have content related to that group.
So when checking “Group A” in reports all the pages of Group B and C appear as (not set). Idem for B and C.
Are you suggesting that I should only use one “father” group? If not, what to do with all the pages of other groups?
Thanks!!
Paul Koks says
Hi Johny,
Thanks for your comment!
Your setup could definitely do. It just depends on what insights you want to get.
I think a very large (not set) bucket negatively impacts a larger high-level analysis. That is not focused on one type of content.
I would recommend to leave them the way the are, but in addition set up a more “high-level” group D that covers you entire website structure.
By doing this you can get the maximum out of your content groups.
Hope this helps!
Paul
Johny says
Hey and thanks a lot for your reply!
But once url can be only in one Group (A, B, C or D) a the same time or this is not right?
Paul Koks says
I think I misunderstood. I thought you were talking about content grouping A, B, C and D. As you can set up five in each of your views.
It’s true that one page/URL can only be placed in one group within one content grouping.
Can you give me a concrete example on this:
“So when checking “Group A” in reports all the pages of Group B and C appear as (not set). Idem for B and C.
Are you suggesting that I should only use one “father” group? If not, what to do with all the pages of other groups?”
If you drilldown in our content group you will always see the pages that belong to that group.
Send me a quick email otherwise (via contact form) and I can look into the exact situation.
Thanks,
Paul
Johny says
Hi, it was my mistake. Same url can be in every one of the 5 groups and I thought they couldn’t. So your solution makes totally sense. Analyzing every group in detail and then having a “overall” or “global” group for user flows between web sections.
Thanks a lot for your support!
Paul Koks says
Sure, I am glad to help!
Thomas says
Thanks for the article!
Let’s say I am now on the screen you show under “Navigation Summary”, after Step 2. We see 61% have been within the “Blog post” group before they – well – surfed within the “Blog post” group and 70% view another blog post.
I am now trying to determine user flows *between* Product Groups, ie. which *other* groups have they visited before (or entered), which have the visited *after* (or exited). I have experimented w/ segments, but I could not find a definition that would give me that view.
I think the User/Behavior flow don’t help here, since I don’t care in which step a user has gone to my Product Group. If this happens in step 1, 3, and, say 12, I want them all combined/summed up.
Any hint on how this could be done?
Thanks!
Paul Koks says
Hi Thomas, I have experimented with a same-like question in the past. To be honest, Adobe Analytics is much better to solve this kind of pathing queries. User and behavior flows don’t work well here. You should try to use segmentation (sequential). However, one segment won’t do the trick, you will need to define many, but it get’s very complicated to illustrate it here. Could you provide me with as detailed instructions as possible (about what you exactly want to achieve). You can make up the names of the products groups and then I will take another look. Cheers, Paul
Brandon says
Hi Paul,
I’m facing an issue, I can’t configure [group using rule definitions] with [screen name] using regex. For reference GTM in implemented in my website and I use [screen name] instead of [page] variable because I need to base my contain grouping settings on sub-domain data.
Many thanks for your help
Paul Koks says
Hi Brandon,
Please note that screenName is related to measuring apps.
https://developers.google.com/analytics/devguides/collection/analyticsjs/screens
So if you want to measure something on a website, you shouldn’t use this dimension.
“I need to base my contain grouping settings on sub-domain data.”
You have the option to attach the request URI to the hostname, so that your “page” dimension includes your subdomain as well. This might help you out.
This guide will help you set this up: https://online-metrics.com/google-analytics-filters/ (search on “hostname and request URI”).
Hope this helps!
Best,
Paul
Brandon says
Hi Paul,
Thanks for your reply. In fact use screenName could avoid your suggested option (set with filter configuration).
The strange thing is that this variable is available as dimension through Custom report even if the ID-UA is not set in an app.
Anyway I test your solution and I hope regex will work.
Paul Koks says
Hi Brandon,
Ok, I hope this solution will work. It’s true, independent of what you choose in the configuration, all “app” dimensions are available. You could actually collect web and app data within one property. However, this is not recommended.
Best,
Paul
Brandon says
Ok thanks for these advices. Everything work at last and only some minor adjustments need to be done following your article.
Again, thanks for your help.
Paul Koks says
Sure, you’re welcome Brandon. And I am glad it works now!
Vincent says
Hi Paul,
Thanks a lot for this very insightful guide.
One thing that I’ve noted is that content grouping is not retroactive. So circumvent this, I’ve tried to take the same criterias and use them in a filter. For instance, same regex but listed in an advanced filter.
The issue I have is that I don’t get the same results on days where I can apply both: not the same number of pageviews when filtered vs grouped.
How can this be possible?
Paul Koks says
Hi Vincent,
Thanks for your comment! You are right, content grouping is not retroactive.
Here are my thoughts:
– The number of pageviews when applying an advanced filter might be higher.
– This could be caused by how your content group is set up; as one pageview might be attributed to an earlier group (let’s say group number 1 instead of 8) by the way your RegEx is set up. In that case you won’t be able to match the RegEx of group 8 with an advanced filter.
If this is not the case, numbers should match. And make sure to not try to match todays numbers.
Hope this helps!
Best,
Paul
Neto says
Can you please explain me something:
as said in the docs I have to set the content grouping just before calling the send, like that:
ga(‘set’, ‘contentGroup5’, ”);
ga(‘send’, ‘pageview’);
But what if I send other pageviews to analytics, are they gonna be registered as contentGroup5 ?
Paul Koks says
Hi Neto,
All your pageviews will be registered as normal in the “All Pages” report.
Only these page(s) where you add additional content group tracking, will be attributed to a content group. All other pages will end up in the (not set) bucket.
Best,
Paul
Sacha Jennis says
Hi,
is there a way to delete a content group in a view after it’s being setup and running for a while? I don’t see this option in GA. Of course, I can adjust an existing group and change it to another, but this will effect the data view of course.
Kind regards,
Sacha
Paul Koks says
Hi Sacha,
You can’t delete a content group and that’s why I always recommend testing your setup first in a test view before applying it to your master view. In addition, you can use annotations when you modify the content group settings – which affects the data in the view.
Best,
Paul
Martha says
I used content grouping for FB’s Instant Articles. I’m interested to know where else those articles show up – would they be mobile view or direct view? Do you know? And, do you know if there’s a way I can see referrals in content groups? Thanks!
Paul Koks says
Hi Martha,
Thanks for your comment! I am not directly familiar with FB’s Instant Articles, but based on this resource, it seems you can measure it in Google Analytics. Usually they would show up as part of your direct traffic, or you need to specifically set it otherwise.
That being said, it works with an iFrame which can bring other measurement challenges.
Content groups are not about direct, referrals, paid search etc. It’s all about measuring the content that is part of your content group setup.
Hope this helps!
Best,
Paul
Sacha Jennis says
Hi Paul,
is there a way to get a table or pie chart in a (Analytics or Datastudio) custom report with a split of content groupings in terms of percentage of all pageviews? I want to know which percentage of all pageviews can be attributed to all content groupings without having to look at the separate data from each content groupings. From my experience, it’s only possible to select a separate content group and show a page content report for this group, not for all content groups.
Would be a nice metric to get a quick insight in what kind of content works best I believe ;-)!
Kind regards,
Sacha
Paul Koks says
Great question Sacha! And I think this should be possible, especially when using Supermetrics (or a different tool) and Google Sheets to extract and modify data from the different content groupings. Then you would have all flexibility (and formulas) to do whatever you want with your data. After it, you can use it in Datastudio. Best, Paul
John says
Hi Paul,
Thanks for the detailed guide. I am quite new to GA. what is the different between the content drill down (which classify pages under folder) and content grouping?
Paul Koks says
Hi John,
With Content Grouping you are much more flexible in how you group the content and how you use it in your analysis.
Content drill down is a good, but basic report.
Best,
Paul
JS says
Hi Paul, this is a really great article.
But I’m having problem for the content group work with GTM. I followed the youtube link you provided. End up I only able to see (not set) in the GA report.
window.dataLayer.push({
‘postAuthor’: ‘paul’,
‘country’: ‘my’,
});
I already setup the content group index in both GA & GTM. I turned on the preview mode and debug in Tag Assistant (Chrome extension), and I see the result
contentGroup: [{index: ‘2’, group: ‘my’}, {index: ‘3’, group: ‘paul’}]
I did this 3 days ago, until today still only see (not set) result. Any idea?
Paul Koks says
Hi there, not sure what’s causing the issue. I always work together with developers to implement the dataLayers.
And I can’t properly debug it from here. Hope you can get it to work!
Shafiya says
Hi Paul, Can you please guide me on how to pull content grouping data using analytics edge.
Paul Koks says
Hi Shafiya,
Unfortunately, I am not using that tool for pulling data. Best bet might be to do a search in Google on the information you are looking for.
Alex says
This is by far the most nuanced explanation of Content Groups I’ve found online… so congratulations on that and thank you very much for it!
Set up to my question:
We have a network of travel-related sites, whose data we segment by destination geography: Continents – Countries – Regions – Cities. This amounts to thousands of different pages, tracked through multiple Analytic accounts and properties, using this solution:
var _gaq = _gaq || [];
_gaq.push([‘t1._setAccount’, ‘UA-XXXXXXXX-1’]);
_gaq.push([‘t1._trackPageview’]);
_gaq.push([‘t2._setAccount’, ‘UA-XXXXXXXX-2’]);
_gaq.push([‘t2._trackPageview’]);
Suffice it to say, this is getting to be unmanageable, and we’ve decided to migrate to a single-tracking ID solution and assign a Content Grouping to each geography level (Continent, Country, etc.) and then dynamically modifying the tracking code, depending on the related travel destination of the page. So the tracking code on a pages about Paris, France would look something like this:
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘UA-XXXXXXXX-1’);
gtag(‘set’, {‘CONTENT_GROUP_1’: ‘Europe’});
gtag(‘set’, {‘CONTENT_GROUP_2’: ‘France’});
gtag(‘set’, {‘CONTENT_GROUP_3’: ‘Ile-de-France’});
gtag(‘set’, {‘CONTENT_GROUP_4’: ‘Paris’});
Questions:
1. You said we can create Five groups per VIEW… but how is this possible using tracking codes, if codes are created at a PROPERTY level? If I created 10 Groups in two Views from the same Property, wouldn’t they cancel each other out somehow or can I simply create multiple “content_group_1” within the same tracking code and each Group 1 would appear in its corresponding View, without distorting the data?
2. If I want to use identical tracking code Content Groups in multiple views and all are configured identically… will a unique snippet suffice to send the same data to each of those views?
3. Finally, if I want to analyze pages for the city of Paris, France… how do I avoid including data from Paris, Illinois? Maybe the solution is with a Custom Segment with “content group COUNTRY contains France”… or is there another solution?
Thanks again for your great content! And Merry Xmas!
Paul Koks says
Hi Alex,
Happy New Year and thanks for the heads up!
About your questions:
1) Definitions are very important here. What I mean:
For each content_group call, you can identify only one Index Number – Group Name pair. Once you have updated your pages with the tracking code, those pages are then grouped according to how you identified them by index number and group name. If you call the same index number multiple times on the same page, then only the last call for that index number is sent to Analytics.
2) Yes, I believe that works. (my primary experience is om GTM and the non-tracking code methods)
3) Yes, you can use segmentation (or a custom report or get the data outside of GA via the API).
Gabriela Lauer says
Hi Paul,
thanks for the clear article. I would like to set up a table in a custom report or data studio with my content grouping (all pages that contained a category: e.g. page contains /lips/; page contains /eyes/..) with the following KPIs: Sessions, Transactions, Conversion Rate, Revenue
Apart from Sessions, I only get the ecommerce metrics for the ‘not set’ part and not for my categories. Why?
In the end I want to know how many sessions that included at least one page view of a specific category ended up in a transaction.
I am able to do this when I apply a segment with for example:
sessions include/ page/ contain/lips
..and apply this segment to the sales performance report. But I need an overview where I have all the possible categories together in one table.
Is it not possible with content grouping?
Paul Koks says
Hi Gabriela,
I believe this is not specifically related to content grouping, but just because certain dimensions and metrics don’t go together.
You can have: Transactions, CR and Revenue per “landing page”.
However, you shouldn’t combine these metrics with the dimension “page”.
When applying segments, this works differently.
Hope this helps!
Paul
Lisa Walder says
Thanks Paul, very helpful as always!
Paul Koks says
Hi Lisa, glad to hear this article is helpful for you!
Chris says
Hi,
I just can’t seem to get this to work. My page (urls) are of the form:
/nnnn/…………… where nnnn is a 1 to 4 digit number. Each number indicates a specific community on the site.
ex. /2001/docs/test.htm, /2001/home.htm
I have tried using extraction to group then on this number with no success. I have tried:
/\d{1,4}/*
^/\d{1,4}/
Any ideas? Have I misunderstood something?
Paul Koks says
Hi Chris,
Could you try the RegEx below?
^/[0–9]{1,4}/
Please let me know whether this works. You can check the outcome in the “All Pages” report first.
Best,
Paul
RayWu says
Very helpful, thanks Paul!
A quick question: since content grouping is view based, and tracking id is property based, if I use the following code to set content grouping, then which view should be changed (assume I have multiple views under the property)?
ga(‘set’, ‘contentGroup1’, ‘blabla’);
Also, can I use ga(‘set’, {hitType:’pageview’, page: ‘/post/123′, contentGroup1:’blabla’}) ?
You say “Within a grouping you can create multiple content groups.”, but google says: “Each content grouping can have up to 100 content groups. ” (https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference), so a little confused.
Thanks a lot!
Paul Koks says
Hi Ray,
I might have mixed up the terminology.
“You can have up to 5 content groupings, each of which has an associated index between 1 and 5, inclusive. Each content grouping can have up to 100 content groups.”
The content groups are the different groups within a content grouping and those you can have 100 per each content grouping.
I recommend setting up the content grouping for your main, master view. Not sure whether your ga command works, I have always implemented it via GTM, web developer or manual URL extraction.
Best,
Paul
Laci Fišer says
Hi Paul!
Thanks for the great article.
I have a question, I hope you can help me. I’m trying to do content grouping by extraction and I have come up with this regex: \/products\/category\/(.*?(?!-))[\/\?#\W]
I’m trying to extract the part of the URL after the category/, while there are a few different endings to the url. Below you can see a set of URLs which represent all cases that can occur.
/products/category/bathroom
/products/category/bathroom?p=1294
/products/category/bathroom-furniture
/products/category/bathroom-furniture?page=2#product-list
/products/category/bathroom-furniture/favorites?p=1488
/products/category/wardrobe#product-list
I’d like to have these 3 content groups: bathroom, bathroom-furniture, wardrobe
I tested it here https://regex101.com/, it works like a dream but for any reason Analytics is not accepting my RegEx, saying there is something wrong with it. Could you have a look at it and tell me what should I do differently so my Analytics accepts it?
Thanks a million.
Best,
Laci
Paul Koks says
Hi Laci,
Thanks for the heads up!
To be honest, I hardly use the “extraction” method when setting up content grouping. Not 100% what is causing this not to work – I think some of the characters are not recognized as RegEx in GA.
Could you try out “group using rule definitons” instead and defining three groups.
For example group 1:
\/products\/category\/(bathroom|bathroom\?p=[0-9]{4})$
It should not match “bathroom furtniture” as the $ ends the string.
You can also double check the Regular Expression in the All Pages report.
Hope this helps solving it.
Best,
Paul
Florian says
Hi Paul,
Thanks for the article.
I noticed the landing content group is deactivated in the API (it is written in grey and not orange as it use to be):
https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/
Do you confirm the same on your side? If yes, any suggestions to get this data via the API?
Thank you for your help,
Florian.
Florian says
My bad, looks like it actually works. Don’t know why they used another colour ¯\_(ツ)_/¯
Thanks anyway for the post!
Paul Koks says
No problem, glad you got it resolved!
Deepak says
Great Post!
Could you please tell me in GA4 how many content groups we can make?
and please post the article on content Groping in GA4.
Paul Koks says
Hi, currently only one.
Please see this article for more details on GA4 and content grouping.