Web Analytics

How to Create Content Groupings in Google Analytics

Content Grouping in Google Analytics is used to reflect the logical structure of your site. It is typically used to compare and aggregate data within groups you create. It also helps in analysis of your data, as you do not have to deal with messy URL’s, when you try and aggregate groups of data or compare sections of your website.

A good example for Content Grouping is the grouping of the Mens and Womens sections of a fashion e-commerce site. Men’s and Women’s will become the content Groupings. The Groups within the Content Grouping are products such as t-shirts, pants and shoes. The Grouping will become a dimension within Google Analytics.

Please do not confuse Content Groupings with Groups. The Content Grouping is the outer shell that houses Groups within it.

How To Implement Content Grouping

Content Grouping is applied on the “Views Level” within the Admin Area of Google Analytics.

You should also be aware that you are limited to 5 Content Groupings, which house your Groups. There are three ways you can create Content Groupings within Google Analytics.

Three methods of Content Groupings:

1) Code Changes

2) Extraction Method

3) Rules Method

1) Code Changes

Code Changes are implemented through modifications made to the Google Analytics tracking code.

We will not be looking at this Method in depth for this blog post. It should be mentioned that the advantage of using this method is that the Groupings do not break with site structural changes. The disadvantage is that Code Changes require developers to be involved for the initial setup.

2) Extraction Method

This method creates Groups through the process of extraction. The extraction is based on existing data dimensions within Google Analytics.  The data comes from either the URL, Page Title or Screen name. You would use a Regular Expression (Regex) to gather the value/groups from one of the data dimensions and create Groups from it.

If you had URLs of say: /mens/shirts  and /mens/pants you can extract the groups ‘shirts’ and ‘pants’ out of the URL using Regex.

To implement the method follow the steps below:


  • Go to Admin, then to the view you want to implement the Content Groupings in.
  • Select the option “Content Grouping”.
Google Analytics Views

Step 2:

  • Enter the Name of the Content Grouping you would like to create.
Content Grouping


Step 3:

  • Select the Method “Extraction”.
  • Select the data dimension you would like to use. For example: Page, Page Title or Screen Name.
  • To automatically create the Groups use Regex (.*) after the point where you would like the groups to be extracted from as shown below.
Content grouping Extraction

This Regex will create Groups out of the data dimensions in Google Analytics. You do not need to specify the Group names. This is automatically created by Google Analytics.

In this example the first part of the Regex \/mens\/ defines the Content Grouping “Mens”. By using the Regex (.*) you direct Google to create Groups like “pants”, “shirts”, etc. automatically from the subsequent URL parts. These Groups will all belong to the Content Grouping “Mens”.

If you would like to manually specify your Groups do the following instead:

  • Define your own sets of Groups by specifying what you would like to extract through a “tighter” Regex expression. The Regex required depends on what you would like to extract and which pattern you want to match.


In the two approaches above, you either allow Google to automatically create the Groups using the URL by setting your regex to (.*) or you “tighten” the Regex to match patterns which will result in Groups from the subsequent pattern matches.

3) Rules Method

The Rules Method will achieve the same as the Extraction Method but in a different way.

In the Extraction Method you can only use Regex; where as in Rules Method you can use multiple predefined pattern matching options such as: ‘contains’, ‘starts with’, ‘ends with’ et cetera.  In the Rules Method there is no automation and you will need to set the name for each Group.

Steps 1- 2 :

  • Follow Steps 1-2 in the Extraction Method. The only difference being that you will select the Rules Method this time.

Step 3:

  • Name the Groups.
  • Then select the pattern matching type. In the example we have the data type Page and Regex as our pattern matching type.
Rules Method Content Grouping
  • Use the “OR” “AND” function when your site URL structure is complex or messy.
Rules Method Content Grouping

Content Grouping is an easy and effective means to bring in additional dimensions within the Google Analytics account. Groups will better reflect the structure of your website or the way you think about your website. It helps you to see structure and to compare groups. The good thing is, this is achieved with very little effort.

If you have any questions please send me an email.