You can too do Content Grouping in Google Analytics
25/03/2011 | Written by | Categories: Analytics Set-up

Seeds grouped by type

I have noticed various posts and comments about how you can’t do content grouping in Google Analytics, that you need to use SiteCatalyst or a similar paid tool in order to do this.  These comments surprise me as one of my first actions with a new client using Google Analytics is to set up content groupings.  So I thought I would write a post detailing what I do and how easy it is.

But I did a quick bit of research before I started and I found that Allaedin Ezzedin of E-Nor had got there first a couple of years ago with this excellent post on content grouping in GA, written for exactly the same reasons.  The first comment is even from the guru Avinash commenting on how you can group functional pages for ecommerce websites.

Reading this post has made me question when I started grouping pages in Google Analytics, whether it was based on my general approach to web analytics and techniques used with other web analytics tools (SiteStat, SiteCatalyst and HBX) or whether it came from this very blog post – I honestly can’t remember.  But explaining what I do may still help some people.

When working on the set-up of Google Analytics for a new client, I am getting into the habit of setting up three or more profiles.  Not for different traffic sources or the reasons people seem to usually create multiple profiles but instead for different levels of content grouping.  So you might end up with these profiles:

  • Level 1 – Page Types only so likely less than 20 page names in use.  A Navigation Summary report for an ecommerce website using this profile could easily see if visitors access the Product Details pages by landing on them or via Product List pages, Search Results pages, etc.
  • Level 2 – Pages would follow the naming convention of /<directory>/<sub-directory> allowing for an additional level of detail.  So article pages on a content website would be grouped by the category and then by topic.
  • Level 3 – Would contain complete page names following a sound and logical page naming convention.  Pages would have been renamed where necessary and this would be the primary profile used in everyday analysis.
  • Level 4 – This profile would still have irrelevant URL parameters stripped out but pages would not be renamed.  It would be used for auditing data similar to a profile that does not have internal traffic filtered out.

If you have a good hierarchical page naming convention in place using a format like /<directory>/<sub-directory>/<page name>, the filters are very easy to set up to create these profiles.  For a Level 1 profile, all you would need is this filter.

Directory Level Page filter

So really, as Allaedin said, there is no reason why you can’t do content grouping in Google Analytics and there are plenty of benefits to be gained from doing so.   GA may not designed for content grouping like SiteCatalyst and other tools but on the plus side, the customisation is possible without any code changes required.

Please add a comment if you have any questions regarding this technique or suggestions for how it could be used.

12 responses to “You can too do Content Grouping in Google Analytics”

  1. catbird says:

    Interesting article – thanks. If I understand correctly, the regex in your example will extract the top level folder from any URI and then replace the complete URI with just that top level folder.

    Also, if your site has a neat URL structure as in your example, why not just use ‘Content Drilldown’ report?

    • Peter O'Neill says:

      @Catbird – that exactly what the regex provided would do. The Content Drilldown report provides the basic information about the content groups but setting up an additional profile like this offers more functionality. It means the navigation summary report can be used to show how visitors navigate between site sections for instance or which parts of the site people are entering through (via the Landing Page report).

      A great example for what you can now do is:

      * select the All Traffic Sources report
      * just display Medium
      * switch to Pivot Table view
      * with a secondary dimension of Landing Page
      * displaying Visits and Bounce Rate

      Try and tell me that isn’t an incredibly useful report. You can get all the data out using segments or inline filters but now you have the complete report available immediately.

  2. Thank you Peter, once again you have literally saved me hours!

    Also, I love that report. Now I just need to pull that into my dashboard and I’m all set.

  3. Tony Gilbert says:

    What would the regex look like if we just wanted to report by page path level 3, for example?

    • Peter O'Neill says:

      Hi Tony – I think something like ^/[a-z0-9_-]+/[a-z0-9_-]+/([a-z0-9_-]+)/ should do the job, depending on the naming convention for your URLs. This won’t cover special characters though so the regex might have to be extended.

  4. Jan Piedrahita says:

    Hi Peter,

    I understand that you can create page grouping using custom variables?
    ie. Product pages

    However, what I would like to do page groups with a hierarchical structure. For example,
    Pagelevel 1 – Homepage (/)
    Pagelevel 2 – Product page (/cars)
    Pagelevel 3 – Product page features (/cars/features)
    Pagelevel 4 – Product page features details (/cars/feature/details)

    Is this possible?

    • Peter O'Neill says:

      Hi Jan,

      If I have you right, no you can’t do it. You can’t set the page level dimension as you choose. However you could start all of the /cars pages with /product – this will push the rest of the information down one level to what you need. It will then get mixed up with all the other pages on your website though. Am sure you can get the information you need, just need to find an alternative way of recording/accessing it.


  5. Micheal says:


    Just wondering if you could help. I am working on a large content based website and I want to categorize the pages to be able to see the traffic to each category separately i.e

    1. Traffic to – EVENTS and other pages in the drop down menu (event/jan..)
    2. Traffic to – ABOUT and other pages in the drop down menu (about/whatwedo…)

    IS this possible in GA? How do I go about it.


    • Peter O'Neill says:

      Hi Michael,

      This should be quite possible in a couple of different ways. The assumption is that pages follow a hierarchical naming convention e.g. /events/ or /about/whatwedo. Then your easy option is to use the Content Drilldown report – it will show pageviews by site section.

      The longer term option (which I recommend/commonly use) is to create a second view (profile). Within this, create a profile filter where:

      • Field A – Request URI – ^/([a-z0-9-]+)/
      • Output – Request URI – /$A1

      This will group all the pages to the first element in their page name.


  6. Helit says:

    Hi Peter,

    Although not a 100% related to your post, but I encountered a problem regarding content grouping and I thought I should give it a shot and as you 🙂

    I tried setting content grouping in my GA account based on rules.
    The rules i set are all based on or conditions of statements.
    Afterwards, when I wanted to set a reports using the content groups as dimension, I couldn’t find it in the dimensions list.

    Any idea why?


    • Peter O'Neill says:

      Hi Helit,

      I’ve been waiting for Content Grouping for a very long time, about time it is here. But looks to be another instances where the GA devs have done all the hard work and forgot the final 10% to make the feature usable for us. I haven’t found access to it in the Primary or Secondary Dimension but have found four X 5 dimensions (one for each content group index) for Custom reports – Landing Page Group, Page Group, Previous Page Group & Next Page Group. Try them out and see how you go.



Leave a Reply

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

Looking to improve your digital analytics or conversion rate optimisation?
Contact us today on +44 (0)20 7148 5970

Alternatively, come visit us in London and we’ll buy the coffee!
Get in touch
Leave us a message
Use the form below to leave us a message.

Lindsey Street