
Have you ever wondered how engaged your website visitors really are? Are they just skimming through a single page, or are they diving deeper into your content, exploring multiple pages in one session? Understanding this behavior is crucial for improving your website’s performance and keeping users hooked.
In the world of analytics, Pages per Session is a key metric that tells you exactly how many pages a user views during a single visit. It’s like a window into your audience’s interest level. The more pages they view, the more engaged they are with your content.
In this blog, we’ll dive into why Pages per Session Conversion matters, how it impacts your website’s success, and most importantly, how you can set it up in GA4.
Jump ahead to:
What is the ‘Pages per Session’ Goal
If you’ve used Universal Analytics before, you might already know about the “Pages per Session” goal. It’s a way to measure users’ engagement with your website by tracking how many pages they view during a single session.
Think of it like YouTube tracking how many videos you watch. it’s a way to see if people are sticking around and exploring your content.
In the older version of Google Analytics, setting up this goal was straightforward. You’d just pick the “Pages/Screens per session” goal type, enter a number (like 4 pages), and every time a user hits that number, it counts as a conversion. Simple, right?
But now, with GA4, things work a bit differently.
How to Set Up “Pages per Session” in GA4
If you’re wondering how to track how many pages users view in a session in GA4, there are two main ways to do it:
Option 1: Using the GA4 Interface
GA4 has a built-in feature called Audience Triggers that can help you track this. Here’s the basic idea:
- You create an audience in GA4 based on how many pages a user views (e.g., 4 pages).
- When a user meets this condition, GA4 can trigger an event, which you can then count as a conversion.
The catch? It’s not as flexible as the old GA3 method, and you might need to work around some limitations.
Option 2: Using Google Tag Manager with a Little Code
If you’re okay with adding a small piece of code (don’t worry, it’s not complicated!), this method gives you more control. Here’s how it works:
- Use JavaScript to count how many pages a user views during their session.
- Send this data to GA4 as a custom event using GTM.
- Set up this event as a conversion in GA4.
This method is more customizable and works great if you want to track specific user behaviors. Let’s dive deep into these methods.
Method 1: Using the GA4 Interface
To track “Pages per Session” in GA4, you can use a feature called Audience Triggers. Think of it as creating events based on user behavior, like viewing multiple pages in one visit. Here’s how it works:
- Go to Admin > Audiences in your GA4 property.
- Create a new audience and set a condition for Page Views (e.g., 3 or more pages in a session).
- Save it, and GA4 will trigger an event when users meet this condition.
It’s quick and code-free, but it has some limitations. Let’s explore how to set it up step by step!
Also Read: GA4 Key Events – All You Need to Know
Creating a Pages Per Session Event in GA4
You can set this in a few seconds. For example, we’re tracking sessions where users view at least three pages as a conversion. Here’s how to do it:
- Go to the Admin section and select Audiences (it used to be under the Configure tab but was moved to Admin > Audiences).
- Click on New Audience to start setting up your tracking.
3. Select Create a custom audience.
4. Give your audience a name, then click on the human icon next to the timer icon. Make sure to set the sequence scoping to within the same session.
5. Under Condition, choose the page_view event. Then click Add parameter, go to Other, and pick Event Count as the parameter.
6. Set the condition to greater than 2, then click Apply.
7. Set the membership duration to 1 day.
8. Under the Audience trigger, click Create New.
9. Enter the event name you want to use (e.g., au_visited_3_pages).
10. Check Log an additional event when audience membership refreshes, then click Save.
That’s it! Your page-depth event is now ready. The next step is to mark it as a conversion in GA4.
Also read: GA4 Audiences: A Marketer’s Guide
Setting Up the Conversion in GA4
Go to Admin > Conversions, then click on New Conversion Event.
Type in the event name you want to track as a conversion. For this example, use au_visited_3_pages.
And that’s it! Your conversion is now set up to track sessions where users view three or more pages.
How to Test If It’s Working
To check if everything is set up correctly, use GTM Preview Mode. Visit three different pages on your site. If it’s working, you’ll see the au_visited_3_pages event marked with a green flag, showing it’s counted as a conversion.
Downsides of This Method :
- Uses Up Audience Slots: GA4 lets you create up to 100 audiences. This method uses one of those slots.
- Limited to One Conversion Per Day: Since the membership duration is set to one day, if a user visits three or more pages in two different sessions on the same day, it will only count as one conversion, not two.
- Counts Total Page Views, Not Unique: If a user reloads the same page three times, it counts as a conversion, even though they only saw one unique page.
- Traffic Source May Show as (not set): Events triggered by this method can sometimes show “(not set)” as the traffic source.
Method 2: Using GTM and JavaScript
Start by creating a Custom JavaScript Variable in Google Tag Manager. Let’s call it CJS – Page Load Type. Here’s the code you’ll need:

After adding the code, click on Format Value in the variable settings. Set both undefined and null to unique (no quotation marks).
How It Works
This code uses a browser feature called Performance Navigation to check how a page was loaded:
- 0: The user visited the page directly, clicked a link, or navigated normally.
- 1: The page was refreshed or reloaded.
- 2: The page was viewed using the back or forward button.
- 255: Some other way of loading the page.
The code uses an if-else statement to return “unique” for first-time visits and “viewed before” for refreshes, reloads, or navigating with back/forward buttons.
You can name the HTML tag cHTML – Pageview Count (Unique Only). This script keeps track of how many pages a user visits and stores that number in a cookie called gtm_page_view. The cookie lasts for 30 minutes and refreshes every time a new page loads.
The script only runs on new page loads, not on page refreshes or when users hit the back button ensuring that unique page views are counted.
To track the total page views in a session, you need to create two variables:
- A 1st-Party Cookie (name: gtm_page_view)
- A Custom JavaScript Variable (name: CJS – Page View Number)
For the 1st-Party Cookie, use gtm_page_view as the cookie name, and name the variable 1PC gtm_page_view (ignore dashes if seen in any reference).
The next step is to create the custom JavaScript variable using this code;

The variable helps track how many pages a user views during their visit.

The code looks at the gtm_page_view cookie and tells you the total number of pages the user visited in that session, showing the result as a number.
Also read: Using Segments and Segment Exploration in GA4
Tracking Conversions in GA4
Since GA4 operates on an event-based system, we first need to send the event data before marking it as a conversion.
To do this, create a GA4 event tag in Google Tag Manager and assign an event name.
For instance, I’ll name it visited_3_pages to track sessions where a user views three or more pages, considering it a conversion.
Once the tag is created, the next step is to set up a trigger.
Go to the Triggering section and click the plus (+) icon to add a new trigger. Choose the Window Loaded trigger type, then set a condition where the variable CJS – Page View Number equals 3.
It means that once the user hits the mark, visiting the third page, this event will fire in GTM with the event data sent to Google Analytics.
Creating a Conversion in GA4 and Debugging
To set up a conversion in GA4, go to the Admin section, navigate to the Conversions tab, and click on New Conversion Event. Enter visited_3_pages as the conversion event name.
With this setup, GA4 will track sessions where users visit three or more pages as a conversion.
To test the implementation, use GTM preview mode. Start by navigating through three different pages. While on the second page, refresh it and check if the GA4 event triggers it should not, as it is still the second unique page view. Once you visit the third page, the event should fire in GTM and appear in the GA4 debug view, marked as a conversion.
This approach is flexible and can be applied across multiple ad platforms, including Facebook Ads, and Google Ads (without importing from GA4), making it a versatile solution for tracking conversions.
Conclusion
Tracking Pages Per Session in GA4 helps you measure user engagement and understand how visitors interact with your site. Whether you use GA4’s Audience Triggers for a quick setup or GTM + JavaScript for more flexibility, this data can improve your marketing strategy. For deeper insights, EasyInsights can streamline data from GA4, Google Ads, and Meta, giving you a clearer view of campaign performance. By tracking user behavior effectively, you can optimize your content and drive better conversions.
To learn more about EasyInsights, book a demo today!