Back to the blogAnalytics

GA4 Not Tracking Page Views? What I Found on My Own Site

Part of GA4 and analytics: a practical guide

For a month, Google Analytics told me my site had 79 sessions and zero page views.

People were clearly visiting, but every page-level report was empty. I couldn’t see landing pages or which posts people read, and I couldn’t tell whether anything I published was working. GA4 was counting visits and nothing else.

This post covers what was wrong, how I fixed it (including the fix that broke something else), and the checks I’d run on any GA4 setup now.


Why is GA4 showing sessions but no page views?

Because something is starting a session without ever sending a page_view event. GA4 counts a session when its tag loads and sends any event. Page views are a separate event, and if nothing sends one, the reports that depend on it stay empty.

On my site, the event list in GA4 made the problem obvious once I looked at it. Over the same month there were 82 gtm.js events, about one per session, and no page_view at all.

gtm.js isn’t something your visitors do. It’s an internal Google Tag Manager message that says “the container has loaded”. GA4 was receiving that message and recording it as if it were a site event, while the page view it should have been sending never went out.

So there were two problems:

  1. Tag Manager wasn’t sending page views to GA4.
  2. Tag Manager’s own housekeeping was leaking into GA4 as fake events.

Does Google Tag Manager track page changes on modern websites?

Not by default. GTM’s standard “All Pages” trigger fires when a page fully loads in the browser. Many modern sites (this one included, built on Next.js) don’t do a full load when you click a link. They swap the content in place, which is faster for the visitor but invisible to that trigger.

On a blog, that matters a lot. A typical visit goes from the blog index to a post and then on to another post. With a full-load trigger, only the first page ever gets recorded.

So rather than patch the Tag Manager container, I moved GA4 out of it and into the site’s own code. The site now tells GA4 about every page change itself, so it doesn’t depend on a trigger that can’t see half the journey. Tag Manager stayed in place for its other jobs.


The fix that broke the landing page

My first version sent every page view from the site’s code, including the first one, and switched off GA4’s automatic page view so nothing would be counted twice.

I checked it in GA4’s Realtime report straight after deploying. Sessions arrived, but no page views did.

The reason was timing. The GA4 script loads just after the page becomes interactive, so it doesn’t slow the page down. My code was trying to send the first page view before that script existed, and the call was silently dropped. Nothing errored and nothing retried. The landing page, the single most important page in any visit, just went missing.

The fix was to split the job:

  • The first page view is left to GA4’s own automatic page view, which waits until the script is ready.
  • Every page change after that is sent by the site’s code.

That went live three minutes after the broken version, because I checked Realtime instead of assuming it worked.


Stopping Tag Manager events leaking into GA4

The gtm.js problem was a shared mailbox.

Tag Manager and GA4’s own tag (gtag) both read messages from the same list on the page, called the data layer. Tag Manager posts its own housekeeping messages there, and gtag was picking them up and passing them to GA4.

The fix was to give gtag its own separate list, so each tool only reads its own messages. Tag Manager still sees the events it needs, such as the contact form tracking, but its internal messages no longer reach GA4.


What happened

Before (20 Aug – 18 Sep)After (24 Sep – 22 Nov)
Sessions79217
Page views0268
gtm.js events82Gone after the fix went live

Page-level reports work now. For the first time I can see that after the homepage, the blog index is the most-viewed page, and which posts people actually read.

One honest footnote: the gtm.js fix sat in my code for three weeks before it was deployed. The fake events stopped the day it went live, not the day I wrote it. Fixed means deployed and checked, not committed.


What I’d tell you

  1. “Sessions but no page views” means your tracking is broken, not your content. Look at the raw event list before you draw any conclusions from GA4.
  2. If you see gtm.js as an event in GA4, Tag Manager is leaking. It isn’t a real interaction, so don’t count it as one.
  3. Check Realtime after every tracking change. A broken tag doesn’t error. It just quietly records nothing.
  4. If your site doesn’t fully reload between pages, make sure page changes are tracked. Otherwise you’ll only ever see the landing page.

If you’re not sure your tracking is right, Why Is My Website Getting Traffic But No Enquiries? is worth reading alongside this one, because broken measurement and a broken website look the same from inside GA4.


FAQ

Why does GA4 show sessions but zero page views?

Something is loading the GA4 tag and sending events, but nothing is sending the page_view event. Usually that’s a Tag Manager tag with the wrong trigger or event name, or automatic page views switched off with nothing replacing them.

What is the gtm.js event in GA4?

It’s Google Tag Manager’s internal “container loaded” message. If it shows up in GA4 as an event, GA4’s tag is reading Tag Manager’s data layer and forwarding its housekeeping messages. It isn’t a visitor action and shouldn’t appear in reports.

Does GA4 track page changes on single-page or Next.js sites?

Not reliably by default. A Tag Manager “All Pages” trigger only fires on a full page load. GA4’s Enhanced Measurement has an option for “page changes based on browser history events”, but if you send your own page views on route changes, turn that option off, or every page change will be counted twice.

How do I check if GA4 page view tracking is working?

Open the site in one tab and GA4’s Realtime report in another. Load a page, then click through to a second page without refreshing. You should see a page_view event for both. For more detail, GA4’s DebugView shows each event as it arrives.

Should I use Google Tag Manager or gtag for GA4?

Either works. Tag Manager is easier if non-developers manage tags. Putting gtag directly in the site gives you tighter control over timing and page changes. What matters is that exactly one of them sends each page view, and that you’ve checked it.

Jayne Hamilton

Jayne Hamilton

Digital marketing strategist working across SEO, paid media, analytics and website optimisation.

More about me