Google Analytics Content Groups enable the ability to organize content in your Google Analytics reports into logical structures. For example: Instead of viewing data for your ecommerce site by individual pages, you can view data for " Bicycles ," and create additional subgroups for " Road Bikes ," " Mountain Bikes ," and " Bike Accessories. " You can configure Tag Manager to send Content Group data to Google Analytics.
Top-level content groups are defined within Google Analytics:
- Create a top-level content group. In Google Analytics, navigate to Admin
View
Content Grouping.
- Click + New Content Grouping.
- Provide a name for the Content Group (e.g. " Road Bikes ") and click Enable Tracking Code.
- 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.
- Click Doneand Save.
Next, go to Tag Manager and add Content Groups to your existing Universal Analytics pageview tag.
- Under More Settings, expand Content Groups.
- Click the Add Content Groupbutton to add a new row.
- For the Indexfield, enter the index number of the top level Content Group that you recorded earlier.
- 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, set up a pageview tag for each Content Group.
To measure content groups with a single tag, create a Lookup Table variable and enter the name of this variable in the Content Groupfield.
This example Lookup Table variable leverages information in the URL to assist with the placement of items into Content Groups:
- Navigate to Variables
User-Defined Variables.
- Click New.
- Click Variable Configurationand select Lookup Table.
- Set the Input Variableto {{url path}} .
- Add your lookup conditions: Click + Add Rowand enter input and output values, e.g.:
Input Output /road Road Bikes /mtb Mountain Bikes /helmets Accessories /gloves Accessories - Click Create Variable.
This variable can now be applied to a Content Group within a single Universal Analytics pageview tag that fires on all pages. To apply this variable to your existing Google Analytics pageview tag
- Open the tag for editing and navigate to More Settings
Content Groups.
- Enter the name of the Lookup Table variable that you created earlier into the Content Groupfield:
| Index | Content Group |
|---|---|
| 1 | {{Content Group}} |
After the container has been published, Content-Group data will begin to appear in your Google Analytics reports.

