• Home
  • Google Analytics
    • Customizations
    • For Ecommerce
  • Speaking
  • About
    • About Me
    • Contact Me
    • Disclaimer and Privacy Policy

Analytics Talk

Digital Analytics for Business

You are here: Home / Tips / How to Set Up Google Analytics Content Grouping

How to Set Up Google Analytics Content Grouping

Posted: January 9, 2014 57 Comments

Today everyone is creating content – lots and lots of content. Measuring that content can be a challenge given the sheer volume that’s out there. That’s where Google Analytics Content Grouping can help.

This feature let’s you categorize your content based on your own business rules. Then, rather than view your data based on page URL or screen name, you can view based on your specific groups.

In this post I’m going to talk about how content grouping works and how you set it up.

Key Vocabulary: Groupings and Groups

There is a little terminology we need to cover before we get into the setup: groupings and groups.

You can create multiple 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 it might be screens from a certain part of your app. It can be just about anything.

A grouping is just a bunch of groups.

Each content grouping contains multiple content groups. A content group contains multiple pieces of content.

Each content grouping contains multiple content groups. A content group contains multiple pieces of content.

You can create multiple content groupings in Google Analytics and switch between them in the reports.

Here’s an example. For my blog I created a grouping called Blog Content Categories.

Within that grouping I create a number of groups to categorize the different types of content on my blog. There’s a group for posts, a group for about me pages, a group for error pages, etc. In the configuration I created a rule that puts each page in a group based on the structure of the URL.

You can view your content data based on groups, rather than URL, screen name or title.

You can view your content data based on groups, rather than URL, screen name or title.

Any item that is not added to a group will appear in the (not set) content group.

It’s important to know that there is not one specific report where you access this data. When you create a grouping it’s literally becomes a new dimension of data. You choose to view that dimension in almost all of the content reports.

Let’s take a look at how you actually create a grouping and groups.

Creating Groupings & Groups

Google Analytics does not automatically create content groupings – you must configure the tool to do that. Navigate to the settings for a specific view and choose Content Groupings.

Content Grouping is a view level setting.

Content Grouping is a view level setting.

Here you will see a list of all your groupings. You can choose to create a new group or edit an existing group.

Here's a list of your Google Analytics content groupings. You can add or edit groupings here.

Here’s a list of your Google Analytics content groupings. You can add or edit groupings here.

There are three methods you can use to create a content group – let’s take a look at each.

Tracking Code Method

This method requires you to add a small piece of code to each page on your site or in your app. The code will literally set the name of the content group when the page or screen renders. Here’s how the code would look for Universal Analytics:

ga('create', 'UA-XXXXXXXX-Y', 'example.com');
ga('set', 'contentGroup5', 'Group Name');
ga('send', 'pageview');

Or, if you’re working in iOS the code might look like this:

id tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-Y"];
[tracker set:[GAIFields contentGroupForIndex:5]
value:@"Group Name"];

The code for a content group is similar to the code for a custom dimension. You can set 5 content groups using the tracking code. Each group is associated with a number, one through five, as shown in the example above.

Check the Google Analytics support documentation for more code examples.

Basically this method let’s you suck in the group name, via code, from some other system. It might be a CMS, a data layer, or just the HTML of the page.

The key is that you somehow add the name of the group to the Google Analytics code.

Pros: Using the tracking code method you can use code to automatically adjust to changes in your content and new content groups.

Cons: It requires IT involvement to set up. But once it’s configured very little IT support.

I should also mention that content grouping is coming to Google Tag Manager. This will provide another way to programmatically set the content group – so stay tuned.

Extraction Method

The extraction method extracts (get it) the name of your content groups from an existing dimension of data. The idea is that you use a regular expression to parse the dimension and automatically extract the name of your group.

For example, the name of your content groups might be in the page title, like this:

Your website might use the name of the content in the Page Title or Screen Name dimension.

Your website might use the name of the content in the Page Title or Screen Name dimension.

I would need to specify that my group name is in the Page Title dimension, and then provide a regular expression that extracts the appropriate value.

The content grouping extract method will automatically pull the name for a content group from a dimension of data.

The content grouping extract method will automatically pull the name for a content group from a dimension of data.

For those of you that do not use regular expression, the value in the parenthesis will automatically be extracted. Google Analytics will then use the value as the group name.

You can see that this one rule will work for every product page on my site – as long as they are well formatted.

Pros: No coding involved. Flexible collection.

Cons: You might need to update your regular expressions when you add new content to your site or app. Specifically something that does not match your existing rules. Believe me – updating settings SUCKS. People forget to do it all the time.

In you’re new to regular expressions check out this reg ex tutorial in the Google Analytics help center.

Rules Method

The rules method is almost exactly like the extract method. The ONLY difference is that you have to MANUALLY name the group. The value for the name is not automatically pulled from a dimension of data.

The content grouping extract method will automatically pull the name for a content group from a dimension of data.

The content grouping extract method will automatically pull the name for a content group from a dimension of data.

Like the extract method you can create rules based on different dimensions of data- the page title, page url or the screen name. If the dimension value matches the rule then the content is added to the group.

Pros: No coding. Don’t need to know regular expressions.

Cons: You need to remember to update your rules when you add new content or if your site urls or app screen names change. Again – updating your analytics settings SUCKS. People forget to do it all the time.

Which method should you use?

That’s a tough question. Personally, I think page category is a critical piece of data that should be added to a page data layer. If you take this approach then using the tracking code method is very scalable.

I also like the extract method. It’s very flexible and reliable – as long as you have processes in place to maintain your implementation :)

Important things to know

Ok, so here are a few very important things to know.

You can use all three methods for creating groups within the same content grouping.

The grouping logic is applied to your data sequentially. That means that Google Analytics first applies the tracking code method first. Then it applies the extraction method. And finally it applies the rules method. You can use all three methods for your implementation.

When a page or screen matches a rule it is added to that group.

A page or screen can only be in ONE content group at a time! That means that an page or screen can only belong to one group at a time.

And finally, content groups are NOT applied to historical data. They are only applied from the moment you configure the feature.

A Best Practice

Because Google Analytics applies all grouping methods to your data, it is possible to use a combination of grouping methods.

But, because they they are applied SEQUENTIALLY, it’s a good idea to put your very specific grouping rules first, followed by your general rules. This way the later, general rules will catch anything that slips through the early, specific rules.

Content Group methods are applied sequentially.

All three content grouping methods are applied to each piece of content. They are applied sequentially.

It’s really, really important to try and get your groups right the first time. While you can edit your groups, there is no way to change the data that has already been processed.

Make sure you test your groups first before announcing them to your entire team.

It’s also a good idea to add an annotation to Google Analytics so everyone knows when the data was added.

Ok, I think that’s it for how to implement this feature.

Don’t worry – I’ll explain how to use content groups in a couple of days.

Filed Under: Tips, Tracking Tagged With: configuration, content grouping, google-analytics, publisher, setup

Comments

  1. Pritesh Patel says

    January 9, 2014 at 10:12 am

    Hi Justin

    Thanks for writing this post. Couple of things I’ve learnt from setting up some groups.

    1) Make sure you check spellings – once you amend a spelling you’ll end up with two groups in your report. One with the wrong spelling and one with the correct.

    2) Test the groups on a test profile first because the data takes a while to collate in your reports. Well on my profile it did. I’ve heard it’s been pretty quick for some though.

    Look forward to the next instalment.

    Pritesh

    Reply
    • Justin Cutroni says

      January 10, 2014 at 9:43 am

      @Pritesh – Great suggestions, thanks for sharing them. And I added your thought on testing your content groupings on a test profile to the post. Thanks!

      Reply
  2. David Whitehouse says

    January 9, 2014 at 10:15 am

    Cheers Justin, that’s really useful, thanks. I had tried to set this up the other day, but had made a mistake when using the rules based method. Hopefully in a few days this will give me some useful data.

    One quick question – is there any way currently, or is there plans in the future, to add the ability to view behaviour/visitor flow by content groups?

    Reply
    • Justin Cutroni says

      January 10, 2014 at 9:46 am

      @David: That’s a good suggestion, something that I will certainly share with the team. But right now the only way to view the flow based on content grouping is to change the nodes in the flow viz reports. It’s duplicate effort, but I think it will create the visualization you are looking for.

      Reply
      • David Whitehouse says

        January 10, 2014 at 11:30 am

        Thanks, I’ll give that a try :)

        Reply
  3. Nastasia says

    January 10, 2014 at 3:56 am

    Hi,
    I would know what is the syntax for including data related to Content Grouping dimension in a Google Spreadsheet (for example making a filter for a specific content grouping or content group).
    I usually use the Google Automation Report (magic) to make my queries in GA ed export data in Google Spreadsheet.

    Thank you very much
    Nastasia

    Reply
    • Justin Cutroni says

      January 10, 2014 at 9:47 am

      @Nastasia – Google Analytics will create a new dimension based on the name of your content grouping. You can extract this dimension using the API. So, if your content grouping is named “My Great Pages” then you should see a dimension with a similar name. I’m actually writing a piece on that and will publish soon.

      Hope that helps!

      Reply
  4. Nastasia says

    January 10, 2014 at 5:11 am

    Another question – is it already possible to implement these new feature with Google Tag Manager?

    Thank you
    Nastasia

    Reply
    • Justin Cutroni says

      January 10, 2014 at 9:48 am

      @Nastasia – Not right now. But eventually you will be able to use Google Tag Manager to implement the tracking code method for content grouping.

      Reply
  5. Julien says

    January 10, 2014 at 9:54 am

    Many thanks for this great article ! I didn’t know this functionnality but i already dreamt about it :) I’ll try to implement as soon is possible…

    Reply
  6. Les says

    January 10, 2014 at 11:52 am

    Another great post (and GA feature) Justin. Thanks for this.

    I really like the concept and applicability. What I don’t like is messing with a site’s code when I know that this feature is coming in GTM. So I’ll wait. Until when?

    Reply
  7. Stuart P. Turner says

    January 10, 2014 at 6:03 pm

    Hey Justin,

    Great post, thanks for sharing this. We’ve been discussing the best way to create a foundation layer of data to report on to clients who produce and promote a lot of content for some time, this looks like a really good place to start,

    S

    Reply
  8. Christopher West says

    January 13, 2014 at 1:14 am

    Thanks Justin

    This looks like a great feature. I’ll have to test it out – might be especially useful to some ecommerce clients.

    Reply
  9. Jacques Warren says

    January 14, 2014 at 8:33 am

    Hi Justin

    Finally! However, it does not seem to be possible to delete a group (!?). Since we’re experimenting, this makes me a little nervous.

    Reply
    • Justin Cutroni says

      January 18, 2014 at 8:43 am

      @Jacque – You can not DELETE! It’s important to get it configured exactly they way you want. You might want to test it on a test view first.

      Reply
  10. Emma says

    January 15, 2014 at 5:31 am

    Hi there!

    Just checking: When you create a new grouping – does it apply retrospectively? Or only going forward?

    Thanks!

    Emma

    Reply
    • Justin Cutroni says

      January 18, 2014 at 8:42 am

      @Emma: When you create a grouping it’s only applied going forward – NOT retroactively.

      Reply
  11. Tom says

    January 16, 2014 at 5:52 am

    Great post, really getting to the nitty gritty about using Google Analytics for content. I feel that I have almost got a step by step guide which I am going to be implementing so that I am not creating duplicate data. Also thank you for the tip about adding annotations about when data was added.

    Reply
  12. Swarup says

    January 17, 2014 at 8:05 am

    Thanks for the details post with screenshot.

    I was not aware about this function in G Analytics.

    I’ll definitely use this :)

    Reply
  13. Dan Antonson says

    January 21, 2014 at 1:02 pm

    Great post, Justin. Thank you!

    Can you comment a little more on the (future) Google Tag Manager integration with this? Should I wait for that integration before I dive in? I’m curious what you feel the Pros (you’re using the super slick tag manager, of course!) and the Cons are of using GTM to manage content groupings compared to the other methods you’ve outlined?

    I’m assuming manual dataLayers for content groupings be more reliable than using URI rules any way? Or am I mistaken?

    Thoughts? Thanks in advance!

    Reply
    • Justin Cutroni says

      January 24, 2014 at 11:41 am

      @Dan: I can’t get into too many details as things usually change :)

      But the reason I like using GTM is that you can create an implementation that will dynamically change. For example, if you are adding the page category to the data layer, and you launch a lot of new content, then your system should automatically add the correct information to the data layer on the new pages. Then that data can be automatically picked up via GTM and sent to GA. There are other ways to do this – you could use rules, as long as the new content pages are designed in a way that matched existing rules.

      My advice is fairly simple. If you absolutely MUST have content grouping for effective reporting within your organization, and it’s a lot of work right now, then implement content grouping! If not, then you might want to wait for the GTM integration.

      Reply
  14. Patrick Le Cam says

    January 24, 2014 at 11:06 am

    Hi Justin,

    Thanks for a great post.

    One thing that I would like to know is: How does Content grouping behaves with the 50,000 unique URLs per day?

    Applying the Rules Method, does the URL has already changed to “(other)”? In this case, I would also lose the grouping.

    Regards

    Patrick

    Reply
    • Justin Cutroni says

      January 24, 2014 at 10:31 pm

      @Patrick: Great question. We never actually change any URLs to (other). (other) is a place holder in a database table. It’s used so we can keep counting the total number of pageviews even though we can not record every single value. We do keep the original URL that is collected, but there is simply no room for it in the table that stores the data (we have certain limits). So when we categorize content we still use the original URL.

      Hope that helps.

      Reply
      • Patrick Le Cam says

        January 25, 2014 at 12:25 pm

        Great, thanks.

        Reply
  15. Alejandro Zielinsky says

    January 27, 2014 at 7:07 am

    Hello Justin, thanks for the heads up about these changes. Maybe you can help me here if i’m missing something, but I don’t really get what’s the difference between content grouping and creating an advanced segment for specific content.

    Regards

    Reply
    • Justin Cutroni says

      January 27, 2014 at 7:06 pm

      @Alejandro: Creating a content grouping will create an entirely new dimension in Google Analytics. You can then use this dimension in many of the content report, custom reports and dashboards. When you roll-up content using an advanced segment you can only view 4 segments at a time. Whereas with a content grouping you can view the aggregate metrics for up to 50k groups. Hope that clarifies things.

      Reply
  16. Bhavuk Khandelwal says

    January 27, 2014 at 8:06 am

    Hey Justin This is really a good and very important info, One quick question what do you think about analytics.js and ga.js i mean which one users should prefer?

    analytics.js is in beta mode so is it good to use this?

    Well thanks for your wonderful stuff keep sharing

    Reply
    • Justin Cutroni says

      January 27, 2014 at 7:08 pm

      @Bhavuk: I would use analytics.js. It is the newest, most up-to-date version of the tracking code. The only reason I would NOT use analytics.js is if you need to use the Remarketing feature in GA. That feature does not work with analytics.js YET.

      Reply
      • Bhavuk Khandelwal says

        January 28, 2014 at 12:44 am

        Thanks for your quick and useful reply justin :)

        Reply
      • Bhavuk Khandelwal says

        January 29, 2014 at 6:11 am

        Hey Justin, I have implemented Google tag manager code in my website and placed gtm code in body tag, then i checked with tag assistant extension in chrome, it was showing that 2 codes are getting fired from my website webpage than i removed the analytics.js code (GA code) from my website. Is this process correct?
        Now tag assistant is showing that my GTM code is working properly but it is showing one error

        Google Analytics UA-&^*(^%-1

        Error : No http Response detected

        can you tell me what i need to do now?

        one more question, i am tracking all the inbound outbound link activity successfully, but i also want to track social activities on my website, i tried some methods but got fail, Do you have any reference article for doing this?

        Reply
        • Les says

          January 30, 2014 at 11:02 am

          By adding the GTM code to your website you negate the need to have the original GA code there. You need to remember to add the GA code to your container in GTM after you have removed the original JS snippet.

          The tag should like this: http://note.io/1kdipCB

          Note that you need to create a firing rule so that the tag fires on all pages.

          To track Social Activities, create a segment that identifies all possible SM properties and apply it to whatever report allows for segmentation. There are some premade segments in the Gallery. I know Avinash made a good one. And I think Justin did also!

          Reply
  17. Owen says

    January 30, 2014 at 8:03 am

    In an account with many views (profiles), how do you transfer content groupings between views without having to create them from scratch for every view?
    thanks

    Reply
    • Justin Cutroni says

      January 30, 2014 at 10:54 am

      @Owen: Unfortunately there is no easy way to transfer a content grouping between views. You’ll need to recreate it – I know, that sucks. I’ve suggested to the team that we add some way to share content groupings. But that may take a while.

      Reply
      • Les says

        January 30, 2014 at 11:10 am

        @Justin & @Owen: I do not see how this would make sense as the possibilities with respect to Profiles & Views would make sharing Content Groupings a dog’s breakfast – IMHO. That being said, I like @Owen’s suggestion.

        Reply
  18. Geo says

    February 5, 2014 at 10:11 am

    Hi Justin,

    Since there is not documentation out yet (or I couldn’t find it), I would like to ask:

    #1 In your example it’s:

    ga(‘create’, ‘UA-XXXXXXXX-Y’, ‘example.com’);
    ga(‘set’, ‘contentGroup5’, ‘Group Name’);
    ga(‘send’, ‘pageview’);

    Can I execute this with the same success:

    ga(‘create’, ‘UA-XXXXXXXX-Y’, ‘example.com’, { ‘contentGroup5’: ‘Group Name’ });
    ga(‘send’, ‘pageview’);

    Yes/No?

    #2 What is the byte limit for “Group Name”?

    #3 I don’t quite get the “slot” thing. If a slot is to be tied to a Content Grouping, then why does the GA interface allow me to choose a slot (instead of automatically assign one). Also, why does it allow me to select slot #1 for two different content groupings at the same time?

    Reply
    • Geo says

      February 5, 2014 at 10:13 am

      Oh, and I forgot: you say that one and the same page cannot be in more than ONE content GROUP at the same time. Does this mean that it can’t be in more than one content group under a certain slot/grouping, or does this mean that it can’t be in more than one content group regardless of slots/groupings?

      Thanks :-)

      Reply
    • Justin Cutroni says

      February 17, 2014 at 2:38 pm

      @Geo:

      #1: Yes

      #2: I’m not sure, but you should probably keep it le22 than 255.

      #3: You get 5 slots, and each slot is a single content group. Therefore you can only create 5 content groups when you use the programatic approach. Obviously this is somewhat limiting – but the slots are there to link the data coming from the code to the data in the reports.

      Reply
      • Alan says

        February 17, 2014 at 9:00 pm

        Thanks for the enlightening post, Justin.

        I’m curious about @Geo’s additional question:

        A page can belong to only one content GROUP within a GROUPING, but can it belong to multiple GROUPINGS?

        That is, can a page can belong to multiple content GROUPS if each group is in a different GROUPING?

        Reply
        • Justin Cutroni says

          February 19, 2014 at 11:07 am

          @Alan: Yes, a page can belong to multiple groupings.

          Reply
  19. Ellen Potma says

    February 6, 2014 at 4:49 pm

    Thank you for explaining this. I now try to implement a test with groupings.. I use rules. But I do not know if these are case sensitive or not. Can you tell me? The Google support page does not tell anything about this.

    Reply
  20. Victor says

    February 13, 2014 at 10:26 am

    Is it possible to identify pages based on a DOM element? e.g an element ID ?

    Reply
    • Justin Cutroni says

      February 17, 2014 at 2:13 pm

      @Victor: Not using the rules-based methods. But you could set up some custom JavaScript that scans the DOM, looks for the appropriate elements, and then sets the content group using JavaScript. Hope that helps.

      Reply

Trackbacks

  1. Marketing Day: January 9, 2014 says:
    January 9, 2014 at 5:02 pm

    […] How to Set Up Google Analytics Content Grouping, cutroni.com […]

    Reply
  2. Marketing Day: January 9, 2014 | CABizNews.com says:
    January 9, 2014 at 7:36 pm

    […] How to Set Up Google Analytics Content Grouping, cutroni.com […]

    Reply
  3. Google Bringing Keywords Back & Other Top Stories | Young & Shand says:
    January 9, 2014 at 11:26 pm

    […] Here’s a useful article that’s sure to come in handy. Google Analytics can get messy and complicated from time to time, so Google have a new way to help organise your content. ‘Content Grouping’ allows users to categorise content in which ever way you want. So instead of just viewing data based on just a page URL, you can group it however you damn well please! Click here to read Cutroni’s detailed guide on setting up this new feature. […]

    Reply
  4. » Gestione URL diverse di una stessa pagina says:
    January 10, 2014 at 4:13 am

    […] una funziona che si chiama Content Grouping. Qui la procedura http://cutroni.wpengine.com/2014/01/09/s…tent-grouping/ MODPosizionamento nei motori di ricerca – WIKIRedattore – Impara la SEO con il nuovo corso […]

    Reply
  5. Content Grouping / Tagging in Google Analytics says:
    January 10, 2014 at 4:37 am

    […] Google Analytis Content Grouping Set-up Details – Click Here  […]

    Reply
  6. How to Set Up Google Analytics Content Grouping – Analytics Talk | Guy R Cook .... thinking aloud says:
    January 17, 2014 at 10:30 pm

    […] http://cutroni.wpengine.com/2014/01/09/set-google-analytics-content-grouping/ […]

    Reply
  7. How to Use Google Analytics Content Groupings: Part 1 | SEER Interactive says:
    January 22, 2014 at 4:52 pm

    […] Groupings don’t have a default setting; you need to set them up yourself. GA documentation and Justin Cutroni have already covered the basics of what Content Groupings are and how to set up these content […]

    Reply
  8. How to Use Google Analytics Content Grouping: 4 Business Examples - Analytics Talk says:
    January 24, 2014 at 4:55 pm

    […] If you have not set up content groupings, please check out my post on how to set up Google Analytics content groupings. […]

    Reply
  9. How to Use Google Analytics Content Grouping: 4 Business ExamplesRoyal CSS | Royal CSS says:
    January 24, 2014 at 5:30 pm

    […] If you have not set up content groupings, please check out my post on how to set up Google Analytics content groupings. […]

    Reply
  10. How to Use Google Analytics Content Grouping: 4 Business Examples | Internet Marketing | News | Bookmark |Tips says:
    January 24, 2014 at 11:57 pm

    […] If you have not set up content groupings, please check out my post on how to set up Google Analytics content groupings. […]

    Reply
  11. ep3: Data-Driven Bloggers | Quantified Web Podcast says:
    January 25, 2014 at 4:14 pm

    […] Tip of the Week: Google Analytics content grouping […]

    Reply
  12. How to Use Google Analytics Content Groupings: Part 1 says:
    January 25, 2014 at 8:59 pm

    […] Groupings don’t have a default setting; you need to set them up yourself. GA documentation and Justin Cutroni have already covered the basics of what Content Groupings are and how to set up these content […]

    Reply
  13. ¡Analiza tus contenidos en Google Analytics de una forma ágil y efectiva con Content Grouping! says:
    January 27, 2014 at 8:03 am

    […] Para ampliar información podéis consultar la ayuda de Google Analytics o leer el post de Justin Cutroni […]

    Reply
  14. Google Tag Manager: Content Grouping - Simo Ahava's blog says:
    January 30, 2014 at 11:46 am

    […] and Content Group is hierarchy. The second is a member of the first. Read Justin Cutroni’s post on Content Groupings to get you […]

    Reply
  15. Google Analytics | A Listly List says:
    February 5, 2014 at 5:30 am

    […] How to Set Up Google Analytics Content Grouping […]

    Reply

Leave a Reply Cancel reply

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

My Books

Google Analytics by Justin Cutroni
Learn More on Amazon.com

Performance Marketing co-authored by Justin Cutroni
Learn More on Amazon.com

Recent Posts

  • Understanding the Google Analytics Cohort Report
  • Using Offline and Online data to drive Google Analytics Remarketing
  • Understanding Cross Device Measurement and the User-ID
  • Universal Analytics: Now out of beta!
  • Advanced Content Tracking with Universal Analytics

Categories

  • About Google Analytics (25)
  • Analysis (52)
  • Analytics Strategy (3)
  • Campaign Tracking (14)
  • Ecommerce (8)
  • Event Tracking (10)
  • Remarketing (2)
  • Reporting (10)
  • Resources (7)
  • Tag Management (5)
  • Tips (25)
  • Tracking (52)
  • Uncategorized (64)
  • Universal Analytics (9)
  • Web Analytics (15)

Copyright © 2023 ·News Pro Theme · Genesis Framework by StudioPress · WordPress