Learn business growth with Google Analytics 4 Forums Google Analytics 4 Google Analytics GA4 Content Groups

  • Google Analytics GA4 Content Groups

    Posted by Luke on 18 August 2022 at 10:42 am

    Hey there, I’ve got ga4 Google Analytics working on my site and the real-time reports are really nifty.

    I have this idea to whip up a new report using “content group” to lump my website pages (and there’s more than 3000 of them!) into 20 or 30 basic categories.

    I tried to get this working by following the steps in this guide and popping in the following code:

    gtag('set', 'content_group', 'ZZZ'); 
    

    Which I slotted right into my GA4 script after this segment:

    gtag('config', 'G-nnnnn' );  
    

    I used ‘ZZZ’ as a placeholder for about 30 different categories, changing it up for each page.

    But then, 48 hours later and despite no alerts from the Chrome console, when I head over to Google Analytics and check out the “Pages and screens: Page title and screen class” report, and try to filter the first column by “content group”, all I get is a whole lot of nothing. None of my ‘ZZZ’ categories are anywhere to be seen.

    Any insight into what could be going wrong here? Thanks!

    Abigail replied 1 year, 4 months ago 3 Members · 2 Replies
  • 2 Replies
  • Minh

    Member
    8 May 2023 at 11:54 am

    Yeah, the doc is wrong when it comes to GA4. You can’t use ‘set’ to drop in ‘content_group’ with GA4 like you can with UA. Instead, ‘content_group’ needs to be set with ‘config’ call, like this:

    `
    gtag(‘config’, ‘G-nnnnn’, {‘content_group’: ‘ZZZ’});
    `

    Or you can do it with individual events:

    `
    gtag(‘event’, ‘event_name’, {
    ‘content_group’: ‘ZZZ’,
    // other event data
    });
    `

    Or even mix ‘n match to override the page-wide content group just for one event.

    Don’t forget that unlike UA where you could have ‘content_group1’, ‘content_group2’, …, etc. GA4 only lets you use one content group.

  • Abigail

    Member
    14 May 2023 at 7:02 pm

    It appears that your implementation of content grouping may not be working correctly. In GA4, Google Analytics has removed content grouping functionality which was available in the Universal Analytics version. Instead, it has an ‘event’ based model. For categorizing pages, you may have to set up a custom dimension and then specify those category values via your tracking code. Make sure the tracking code is placed correctly on all relevant pages and that ‘ZZZ’ is swapped with actual category names. This custom dimension can then be used in your reporting. Also, changes done in Google Analytics usually take 24 – 48 hours to reflect data. If it’s still not visible, make sure you haven’t filtered out any data and double-check your implementation.

Log in to reply.