Google Analytics Content Groups

Google Analytics Content Groups let you organize your site or app content into a logical structure in your Google Analytics reports. For example: Instead of viewing data for your ecommerce site by page, you can view data for "Bicycles," and create additional subgroups for "Road Bikes," "Mountain Bikes," and "Accessories".

Top-level content groups are defined in Google Analytics:

  1. Create a top-level content group. In Google Analytics, navigate to Admin and then View and then Content Grouping.
  2. Click Create New Content Grouping.
  3. Provide a name for the Content Group (e.g. "Road Bikes") and click Enable Tracking Code.
  4. Select an index number (1-5). This number will be associated with the name you provided. You will use this number when you create your tag in Google Tag Manager.
  5. Click Done and Save.

Next, add Content Groups to your existing Universal Analytics pageview tracking tag.

  1. Under More Settings, expand Content Groups.
  2. Click the Add Content Group button to add a new row.
  3. For the Index field, enter the index number of the top level Content Group that you recorded earlier.
  4. Under Content Group, enter a sub-group name (e.g. "Mountain Bikes", or the name of a variable).

If you enter a string in the Content Group field (for example, "Mountain Bikes"), modify the triggers so that the tag fires only on the pages that belong to the "Mountain Bikes" Content Group. In this case, you'd need to set up a pageview tracking tag for each Content Group.

To track content groups with a single tag, create a Lookup Table variable and enter the name of this variable in the Content Group field.

Here's an example for how to create a new Lookup Table variable for a content group. This example leverages information in the URL to assist with the placement of items into groups:

  1. Navigate to Variables and then User-Defined Variables.
  2. Click New.
  3. Click Variable Configuration and select Lookup Table.
  4. Set the Input Variable to {{url path}}.
  5. Add your lookup conditions: Click + Add Row and enter input and output values, e.g.:
    Input Output
    /road Road Bikes
    /mtb Mountain Bikes
    /helmets Accessories
    /gloves Accessories
  6. Click Create Variable.

This variable can now be applied to a Content Group within a single Google Analytics pageview tag that fires on all pages. To apply this variable to your existing Google Analytics pageview tag

  1. Open the tag for editing and navigate to More Settings and then Content Groups.
  2. Enter the name of the Lookup Table variable that you created earlier into the Content Group field:
Index Content Group
1 {{Content Group}}

After the container has been published, Content-Group data will begin to appear in your reports.

Was this article helpful?
How can we improve it?