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.
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
- Enhanced Measurement and Page Views
- Basic Reports on Page Performance
- Advanced Report on Page Performance
- Content Groups
- Concluding Thoughts
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.
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
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:
And the Page Title is what GA4 uses by default in the reports.
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.
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
- 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
- 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.
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. :-)
- Modify the GA4 implementation and configuration tag in GTM.
- Register the “clean” Page Path parameter as a custom dimension in GA4.
- Watch the data flow or use Real Time debugging.
Step 1: modify the basic GA4 Configuration Tag 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:
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: https://online-metrics.com/?gtm_debug=1634736396812.
The red part of the URL is not visible in GA4 which confirms it works!
You can also validate it via the “Explore” section in Google Analytics 4.
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.
Here you can see the dimension value is (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 data in reporting 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 4 Audit Tool. It contains 30 key health checks on the GA4 Setup.
Grace says
Hi Paul,
I have a question and hopefully you can help. When I look at the pages and screen report, I see (other) is one of values in the page path dimension. This is weird. The total pageview in the last three days is about 500,000. (other) took up 96,000. Do you have any idea why there’s (other) in the report and why is that?
Thanks,
Grace
Paul Koks says
Hi Grace,
Please see these two articles:
[GA4] (other) entries in reports
[GA4] Row limits
This will help you understand what’s going on.
Best,
Paul
Juzz says
Hi Paul,
2 quick questions:
1. why is my GA pageviews different to GA4 pageviews? same page, same month but different numbers.
2. I recently try to find the number of pageviews a page on my site had in GA4 in Jan and Feb there were results but now for March / April there is no data available.
Why would that be?
cheers
Paul Koks says
Hi Juzz,
Please see my answers below:
1. Pageviews will never be exactly the same, but overall you shouldn’t see a very big gap. Read more here.
2. Did you test if the GA4 tracking still fires on that page? And do you still see the same amount of traffic in UA/GA3?
William says
Paul:
In GA3, there is a 75,000-page limit, and anything over that gets reported as “other.” Not that we have 75K pages, but they see every page with URL parameters as a separate page. Therefore, every search is now a new page with the URL parameter.
In GA3, I can modify the page and remove the URL parameters – which helps.
With GA4, do you know if there is still a 75K limit on the page? Is the system recognizing the page from the URL parameter? The reports I have seen still recognize the URL parameter as part of the page. Therefore, page1 and page1&q=test are different pages when they should roll up as Page1.
I contemplated hijacking the page_location to be just to the page name, then capturing the URL string separately in a custom parameter. HOWEVER, I have learned the hard way before that changing the Google data collection can adversely affect reports.
What are your thoughts, will changing the page_location to the true page without URL parmaters have adverse efets in the reporting? Obviously Google wont reconise the additional custom parameters that I would add to track this.
William
Paul Koks says
Hi William,
GA3/Universal Analytics and GA4 work differently in that respect. I recommend reading these two Twitter threads:
– GA4 cardinality (1)
– GA4 cardinality (2)
I recommend adding an extra parameter to the page_view event capturing the {{Page Path}} without query parameters
AND
consider stripping the query parameter from the main page URL if you are concerned about cardinality
Cardinality could be an issue at a much broader scope, but that’s something I might discuss in a future post.
Best,
Paul
Harry Suyal says
Landing pages are not showing in real time of google analytics.
I have just added the GA4 code to the website, so in the real time view of the analytics section, the user is showing but the landing page is not showing.
Paul Koks says
Hi Harry,
That’s correct, you don’t find a landing page dimension in that report.
If correctly implemented, you should see “Views by Page title and screen name” though.
Best,
Paul
Dylan Clement says
Is there any way to view unique page views in GA4? I’ve been trying to find a way to get that data as I don’t want repeat views to bump up the numbers.
Paul Koks says
On default, the GA4 UI can show “Views” and “Views per Session” in the Pages and screens report. The “Sessions” metrics comes close to “Unique Views” (if you measure Web).
You can add it (if you have Edit rights) via the “Customize Report” link in the top right corner of the report. Under “Customise report” click on Metrics and then Add Metric. Last step is to select Sessions, apply and save the changes.
Be aware that this will change the setup of the report for all users (if you modify the current report).
gauri says
Hi,
Really informative I have one doubt that if we want to track unique page view how can we do that.
Thank you,
Paul Koks says
Hi Gauri,
Unique page views are tracked, but currently not displayed as a metric (similar to UA).
On default, the GA4 UI can show “Views” and “Views per Session” in the Pages/screens report. The “Sessions” metrics comes close to “Unique Views” (if you measure Web).
You can add it (if you have Edit rights) via the “Customize Report” link in the top right corner of the report. Under “Customise report” click on Metrics and then Add Metric. Last step is to select Sessions, apply and save the changes.
A quick heads up that if you modify the current report, it will modify it for all users that have access to the report. Another option would be to create a separate report with this metric in the Explore section of GA4.
Adam says
Hi Paul,
My mind is blown that GA4 has removed Unique Pageviews. Those are what actually matter. If a person refreshes a page 3 times and converts down the funnel, the conversion rate will be 1/3 using their “Views”. But with Unique Pageviews or Unique Views (or a Session that saw a specific page) the conversion rate would be 1/1. We don’t want to count multiple views of the same page, or refreshes.
So, to get around this massive oversight, I’m trying to create custom funnels within the Explorations section and I want to count Sessions that saw page x, that had a conversion. Do you know how to do this? It appears they have made that either extremely difficult or impossible as well.
I basically need “of all total sessions that saw page x, how many of those sessions had a conversion event”
Thanks for your content and any insight you can provide to this common problem. Cheers.
Adam says
I think I may have figured it out. If you create a session-based segment and apply it, such as Device Type, and the steps in your funnel are specific views of certain pages, it will only count one view per session. I think… lol
Paul Koks says
Hi Adam,
One of the easiest ways to get this done would be to add the “Sessions” metric to a standard report that contains Page Title / Page Path as well as Views and Users.
You can customize the standard reports and add/remove metrics and/or dimensions.
I believe this is more easy than creating a funnel report. Please note that the funnel report on default reports on users per step.
Here you can read more about funnels in GA4.
Best,
Paul
Eduardo says
Hi Paul,
First of all, love the content! Keep it coming.
Now for my question: Could I use path_clean in a funnel exploration report? If that so would path_clean be under page_view as a parameter? Example: Step 1 > page_view > clean_path > contains > abc/xya
Or should I use path_clean directly as a dimension in that case?
I hope I’ve made myself clear.
Thank you,
Thanks for the post
Paul Koks says
Hi Eduardo,
Thanks for the heads up!
1) Yes, you can use ‘path_clean’ in funnel exploration reports.
2) In this case, it would yield similar results as ‘path_clean’ is a parameter only fetched with the ‘page_view’ event.
As a best practice I would also include ‘page_view’ here as that makes it easier if you later re-visit the funnel to see what you have set up and/or want to modify it.
‘page_view > clean_path > contains > abc/xya’ as a first step looks good to me. It even works if you use an AND statement in step one and first specify the event ‘page_view’ and after AND the parameter ‘path_clean’ (or ‘clean_path’ -> how you named it).
Best,
Paul
James says
Hi Paul,
Thanks, this has been helpful to bolster my understanding. I was also quite confused about Content Groups and the lack of documentation. In our Universal Analytics setup, I have one content group using 50+ rule definitions (each being a regex on the page path), but in GA4 it looks like this isn’t possible. I have therefore tried to use GTM instead and use a “RegEx Table” variable that I can link to as a Field in my GA4 Configuration tag, but I’m not sure whether this is best practice.
Interested in whether you have any alternate thoughts…
Thanks!
Paul Koks says
Hi James,
Yes, I believe a RegEx and/or Look Up table in combination with the GA4 Configuration tag is a good way to “copy” your described Universal Analytics setup to GA4.
Best,
Paul
George Thomas says
One generic query on GA4 setup, We have recently found out that in one of the client websites the GA4 setup under data stream the URL is without HTTPS but on UA under property setting URL is with HTTPS. So does that mean the data discrepancy between UA & GA4 will be there? Also, does it affect the events or reports too?
Paul Koks says
Hi George,
Both settings don’t influence the actual data collection so it shouldn’t be the cause of any discrepancies found between UA and GA4.
Rob says
How would it be possible to segment data on a multisite installation where there is an umbrella company domain with multiple sub directories sitting under that main domain?
Each subdirectory is a different division of the main company so it is important to report data for the main domain and individual stats for each subdomain. The structure is similar to this example:
http://www.mymaindomain.com
http://www.mymaindomain.com/subdirectory1
http://www.mymaindomain.com/subdirectory2
http://www.mymaindomain.com/subdirectory3
In UA I created different views using filters to only show data from each subdirectory and then one unfiltered set of data that acted as a roll up to show overall traffic to the main domain but this is not possible in GA4 as far as I can see.
Do you have a method for implementing something such as this please?
Paul Koks says
Hi Rob,
Unfortunately, GA4 doesn’t current support any filters that would allow to do something like that.
In the GA4 UI, there is a comparison feature, but I believe it won’t suit you exact needs here. Also, comparisons will disappear when you re-start another GA4 session.
In GA360 (paid version) you could do something here with roll-up reporting, but it will require quite some work to set it up as well as you need to have the paid version of GA4.
Also, with segments (in the Explore section) it will be cumbersome to set this up, maintain and analyze the data. And the outcome will be different compared to UA.
As a last resort you could try to leverage BigQuery here, BUT this requires advanced skills and goes far beyond this blog.
Hopefully a solution for your request will come in the near future.
Best,
Paul
Flavio Pacini says
Hello Paul, thank you for another good post about GA4.
In one of your answers above you write:
“I recommend adding an extra parameter to the page_view…”
I am trying to understand how to achieve this, without success.
Could you please point me in some direction?
Actually, I would like to add to the page_view event a new “Page title” parameter, which is not the standard tag, but the basic page title, for a better understanding of reports.
Thank you.
Flavio
Paul Koks says
Hi Flavio,
Thank you for the heads up:
– Please see this part which describes how you can add {{Page Path}} as an extra parameter.
– You can fetch the “Page Title” by 1) Creating a JavaScript Variable in GTM with the Global Variable Name “document.title” and then 2) Adding it to your page_view tag (same way as described in the link in my comment).
Hope this helps!
Flavio says
Outstanding Paul, thank you so much!
You have given me the puzzle piece I was missing :-)
My mind was not open enough to think that I should put the extra parameter in the GA4 tracking code event.
I was struggling putting it anywhere else, including in a datalayer push, in a template file, or in another custom event called “page_view”, which simply resulted in a double page_view event.
As to the page title, I have extracted it through a GTM variable -> DOM element -> CSS selector -> element = h1.
Flavio
Paul Koks says
Great to hear you have resolved it Flavio! :-)
Remi van Beekum says
Can this also be used to overwrite the page path?
Situation: Website sells tickets for performances. They use ur’s like:
/ticket/performance?id=103124
In Google Analytics those are hard to interpret. So we used virtual pageviews (something like
ga(‘send’, ‘pageview’, ‘/ticket/performance/NameOfAwesomeBandRocking);
) to solve that in UA.
But we’re implementing GA4 via GTM now. And need some solution to fix this issue.
Can we just push a nice Page Path variable in the Data Layer to overwrite the real Page Path?
Or is the only way to use a Custom Dimension ?
Paul Koks says
In general it is recommended to leave the Page Path as it is, but I believe you could potentially overwrite it.
But, if you don’t really use the Page Title, you could pass these amended values (i.e. via custom javascript variable) into the ‘page_title’ field.
You will have a more user friendly page names for your Pages report AND the pathing functionality becomes more useful.
Ronnie says
Hi great article. I tired a solution but still have trouble for pages in the user explorer report in g4. in UA the user explorer report showed exactly what page the user was on each them they switched pages. In the G4 user explore report it only shows page_view and not the actual page they were on. There is no way G4 isn’t showing the page name in user explorer reports right? What I am missing here to expose the page name when I drill down to a single session in the user explore report? Thank you.
Paul Koks says
Hi Ronnie,
Yes, you can actually if you pull in an extra custom dimension for the ‘page_view’ event. You can use ‘path_clean’ for example (suggested in article).
You will find details on the actual page if you click on the ‘page_view’ event and review the Event Parameters (right side).
Hope this helps!
Paul
Ronnie says
Thanks so much! It worked. Top notch G4 advice. Thanks again.
Paul Koks says
Perfect, great to hear that!
Arun says
I have scenario like below.
The request URIs will be as below
msg/conversations/20001,
msg/conversations/20002
msg/conversations/20003 etc.
For all these types of URIs, I have to show a generic URI msg/conversations/ids.
How can I achieve this ?
Paul Koks says
In that case you could overwrite the ‘page_location’ parameter for these URLs in the GA4 configuration tag. But make sure that the pageviews are sent as expected after you implement this override.
Lam says
Hi there,
I have created a report with page path+query string under the life cycle report (Engagement > Page and Screen) that GA4 provides and created a same page path+query string report under exploration (using Free form). I have checked the date range is under the same period.
However, the views in the two reports show a great difference, do u have any idea why there is such a significant difference between them??
(Engagement > Page and Screen = 231786 vs Free Form = 473269)
Thanks!
Paul Koks says
Quick question, do you see the same number of unique pages or are the number of unique pages in the Free Form report greater?
Lam says
Free Form unique pages is much greater, so which report should I use to show a more accurate result, thanks!
Paul Koks says
Most probably your standard report is suffering from Cardinality. The free-form is more accurate to use as I expect it contains dimension values with low event/user counts where the standard report isn’t. I will elaborate on Cardinality in a future article.
Lam says
OK got it, thank you so much!
Richard says
Thanks for this – however I came across an issue when i tried to use this method. The page report worked fine, however to see a landing page report using the same values, i filtered pages by session start, however session_start does not fire for custom dimensions. To solve this, I switched the enhanced measurement back on, and instead of using a custom dimension/parameter, overwrote the existing page_location (or page_title) variable with my simplified url in the config tag.
This seems to be working fine – but I’m interested if anyone else has come across this issue and solved it another way?
Hope this helps
Paul Koks says
Good feedback Richard, haven’t come across this before, but will let you know if I have a useful comment on this!
Kevin says
Hey Paul,
I know you have a question answered above about a difference in pageviews between UA and GA4. Currently my GA4 property is showing approx a 10% higher number.
Is this normal or is that too much? this number varies from 8% to 12% on various days. FYI, i have no filters setup on either properties and this variation is based on approx 3 million pageviews / day. Additionally, our universal is coded through backend vs our GA4 is coded through GTM. Is 10% a normal difference or should it be less, and if less, what solutions would you recommend to inspect?
Paul Koks says
Hi Kevin,
In my experience this is on the high end, but still ok. There can be several reasons why your count in GA4 is higher with one of them the type of implementation (differs between GA4 and UA in your case).
Do you see this 10% differences across all (main) website pages? That’s something interesting to evaluate. If, on average it goes over 12 or even 15%, then that’s too high in my opinion.