Advanced Guide to Page View Tracking in Google Analytics 4 (GA4)

Google Analytics 4 collects page views by default. Read on if you want to enhance the basic implementation of GA4 to get the most out of page view measurements.

Analyzing page level data is very important when you want to optimize the performance of any website. As you probably know, the data model in GA4 is completely different from Universal Analytics. Page views are one of the many “events” that you can collect in Google Analytics 4.

GA4 Page Views table

In this post you will learn why the basic page view measurements are far from ideal and how to customize the basic setup for cleaner data and greater insights.

Table of Contents

Let’s dive right in!

Enhanced Measurement and Page Views

Enhanced Measurement in Google Analytics 4 allows you to measure certain events automatically as you can see in the list below.

GA4 Enhanced Measurement Page Views

Page views are captured when a page loads or when specific browser-history events occur (when you select the second box). This browser-history event option listens for pushState, popState, and replaceState.

Make sure to always test your implementation properly, especially when you deal with Single Page Applications (SPAs).

Ok, this is good to know. But what data is sent to your Google Analytics 4 property? Google’s support document mentions two parameters that relate to the “page_view” event:

  • page_location = URL, including http(s) and all query parameters.
  • page_referrer = previous page URL

GA4 page_view event

A different support page, Automatically collected events, lists “page_title” as another parameter that GA4 captures.

One report card in the “Real-Time” reporting section confirms this:

GA4 - page_title - parameter

And the Page Title is what GA4 uses by default in the reports.

GA4 Reports AND Page Title

The “page_location” isn’t very readable and there is a challenge with the “Page Path” dimension as well!

The GA4 Dimension and Metrics explorer lists the dimension that is currently available in the reporting interface.

GA4 Page Path + query string

You can imagine how challenging this is when you run a(n) (Ecommerce) site with tons of query parameters.

No worries, let me show you what Google Analytics 4 page view reports are available out-of-the-box and what steps to take to enhance your reporting.

Basic Reports on Page Performance

In the GA4 reporting interface you have two options when it comes to Pages and Page Views reporting:

  • Pages and screens: Page title and screen class
  • Pages and screens: Page path + query string and screen class

Let me show (again) that both reports are far from ideal.

Page title and screen class

GA4 Pages and screens - Page title and screen class

  • Page level data is hard to analyze when Page Titles are not accurately set.
  • It’s also very hard to group certain pages into larger groups.

Page path + query string and screen class

GA4 Pages and screens - Page path + query string and screen class

  • Query parameters create duplicate versions of pages in GA4.
  • For example, roughly 80% of all Google Analytics Demo Store pages contain at least one query parameter.

In my opinion, both options are far from ideal when analyzing page level data in GA4.

The third, basic option that you have is to use the “Explore” functionality and use Page Location = page_location.

GA4 Explore Page Location

Not a lot better I think. The full URL is shown and it includes technical query parameters you most probably want to strip from the URL!

Advanced Report on Page Performance

GA4 currently has no option to filter out query parameters via the Reporting View settings (no Views structure) or Admin filters.

Is there a better solution? Of course, otherwise I wouldn’t take the time to write this blog post. 🙂

  1. Modify the GA4 implementation and configuration tag in GTM.
  2. Register the “clean” Page Path parameter as a custom dimension in GA4.
  3. Watch the data flow or use Real Time debugging.

Step 1: modify the basic GA4 Configuration Tag in GTM.

GA4 - add Page Path dimension in GTM

  • “path_clean” is an extra parameter pulled in via the built-in GTM variable {{Page Path}}.
  • You can change the “Field Name” to what suits you and your naming conventions best.

Step 2: register the parameter as a custom dimension in GA4.

  • Go to Configure > Custom definitions.
  • Click on “Custom dimensions” and then “Create custom dimensions”.
  • Fill in the information based on your GTM setup.

Here is how it looks like on my end:

GA4 clean_path parameter

Note: you won’t be able to use your data in the Advanced Reporting section (Explore) if you don’t register the new parameter.

Step 3: watch the data flow or use Real Time debugging.

Here I use GTM preview & debug with the following URL:

The red part of the URL is not visible in GA4 which confirms it works!

GA4 path_clean parameter test

You can also validate it via the “Explore” section in Google Analytics 4.

GA4 Explore path_clean

Now you know how to analyze page view data via the following sections/parameters:

  • page_title
  • page_location
  • Page Path with query parameters
  • Page Path without query parameters

There is one more option that I will quickly touch upon in the next section.

Content Groups

Here you can find an extensive post on Content Grouping in Universal Analytics.

At the time of writing, there is no clear documentation on Content Groups in Google Analytics 4. Also, the Google Merchandise Demo Store doesn’t store this data.

GA4 content group demo account

Here you can see the dimension value is (not set):

GA4 demo account content group = (not set)

However, it is possible to set this up via Google Tag Manager. I have experimented with it for quite a while and it turns out that you need to set one field to “content_group” and you can pass the data (dynamically).

GTM setup

GA4 OM content group GTM

GA4 data in reporting interface

GA4 OM content group interface

In a future blogpost I will share more on content groups in GA4, but this should get your started! Last note, currently you can only set up one content group in GA4.

Concluding Thoughts

Google Analytics 4 can be a great tool to extract more insights from your data, but only if set up properly.

Making sense of page performance is key on any website so make sure to review the out-of-the-box implementation and make adjustments where needed.

I highly recommend capturing a “clean” Page Path dimension at a minimum as it is not (yet) available by default. In addition, think about mapping your (most important) content group(s) in GA4.

Also, I expect more out-of-the-box options to become available in the future.

Now it’s your turn! Do you have any thoughts on pages, page views and related measurements in Google Analytics 4 (GA4)?

One last thing… Make sure to get my automated Google Analytics Audit Tool. It contains 25 key health checks on the Google Analytics Setup.

Get Free Access to The Google Analytics Audit Tool

Source link