Google Analytics 4 Pageview Custom Dimensions and Content Groupings

I decided it’s time I’d learn GA4 so I figured I’d implement it net new and figure it out along the way. A couple of things I rely on heavily on my sites are Content Groupings and Custom Dimensions. Luckily, GA4 handles these a lot better than UA—even if they are still a bit cumbersome.

I learned that there is only one Content Group parameter called content_group (instead of 5). It seems at first glance that event-scoped custom dimensions are capable of doing that which content groups used to handle (thanks to the new event-first rather than session-first paradigm).

To set customer dimensions, you can just set arbitrary parameters like canonical_name or page_author.

Shown below is an example of the query parameters that are sent with the page_view hit. Notice that the “ep.” (event parameter) prefix is added by the GA code. (I only passed canonical_name as a parameter) and GA adds the prefix when the hit is sent. This is also true for content_groups.

The query string parameters correspond to the Measurement Protocol

  • en: page_view
  • ep.criteria_id: 2554
  • ep.canonical_name: New%20Zealand
  • ep.countent_group4:
  • ep.countent_group3: NZ
  • ep.countent_group1: Country
  • ep.countent_group2: Active
  • ep.debug_mode: false

Notice that I set debug_mode to false so that I could take advantage of the debug view in the Google Analytics UI. That thing is pretty neat and helpful for spot-checking custom parameters.

One thing that seemed silly was that I couldn’t just arbitrarily name my content groups and assign them in the UI, but hey, it’s still a lot better than UA.

Defining and Naming Your Custom Dimensions

After you send the parameter with the hit, you have to set up the custom dimension in the GA4 UI. You can set them up by going into the left panel and selecting “Custom Definitions.”

The nice thing is that, if you’ve already set a parameter, you can just select the parameter name from the list and all you have to do is provide a Dimension Name and Description.

Pageview Custom Dimensions in Reports

To see the custom dimensions in a real report, you can go into the left panel and select Engagement > Pages and screens. Then you can find the dimension by clicking the big blue plus sign (+) and selecting whichever you like.

If you’re curious about how it works and you want to see it for yourself, you can go to the site and open up your Network console and filter for “?collect” to see the GA hits. The site is here: https://analyticscodes.com/ Please visit and send some data into that GA4 account!

Leave a Comment

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