top of page
Search

Rethinking Web Analytics: How to fix GA4’s Hidden Session Problem

  • Writer: Marc Alexander
    Marc Alexander
  • 6 days ago
  • 4 min read

Every marketing dashboard depends on one simple idea: that a “session” in Google Analytics 4 (GA4) represents a real visit.


But what if it doesn’t?


What if the numbers senior teams use to judge campaign performance, conversion efficiency, and engagement are quietly distorted by the way GA4 handles time?


That’s exactly what I discovered — and what led me to build a lightweight browser-side layer that makes GA4 see reality, not just timestamps.



The hidden problems in GA4 sessions


GA4 is built on events — but organisations make decisions on sessions. And that’s where the cracks begin to show.


A session in GA4 is supposed to represent a single visit: a person arriving, engaging, and leaving. But in practice, modern web conditions constantly break that simple story.


Browser privacy updates, consent banners, iOS link tracking protection, and redirect layers all interfere with how GA4 interprets the start and end of a visit.


The result is a network of small, invisible inconsistencies that add up to big analytical blind spots:


  • Campaign links that lose their UTM parameters before GA4 even loads

  • Users who return after a break and trigger new session IDs with no corresponding pageview

  • Landing pages marked as “(not set)”

  • Conversions credited to “Direct” instead of the real source

  • Duplicate or missing sessions when consent is delayed

  • Attribution paths that simply don’t match how humans browse anymore


In short: GA4 measures events, not visits. And in today’s privacy-first web, those events arrive incomplete, delayed, or stripped of their context.


That’s what I set out to fix — not by changing GA4 itself, but by restoring the continuity, attribution, and timing logic that GA4 silently loses between the browser and your reports.



Introducing the Session Integrity Layer


The solution that I have created sits entirely in the browser, deployed through Google Tag Manager, and activates only after the user consents to analytics. It doesn’t send data anywhere new — it simply governs how GA4 interprets what’s already there.


Its job is to make sure that sessions begin and end like real visits, not just technical intervals.


Here’s what it does:


Consent-based attribution recovery


iOS and other privacy systems strip tracking parameters like utm_source from links to prevent cross-site tracking.


The Session Integrity Layer offers a compliant workaround: campaign URLs can use harmless hash/anchor fragments (for example #source=) that aren’t affected by link-tracking protection.


Once a user gives consent, The SIL securely converts those fragments back into standard query parameters, allowing GA4 to recognise campaign attribution while staying fully GDPR-compliant.


Session mirror


It reads GA4’s internal session cookie and mirrors it in a small, consent-based cookie of its own. This cookie tracks the same session ID and last-activity timestamp, ensuring both systems stay perfectly aligned.


GA-anchored expiry


The Session Integrity Layer doesn’t rely on timers or assumptions. It watches GA4’s cookie directly and knows a session has expired the moment GA stops updating its timestamp — exactly 30 minutes after true inactivity. The SIL then triggers a synthetic pageview, so every new session in GA4 has a proper landing event attached.


Landing vs. pageview intelligence


Unlike GA4, which treats all hits equally, the SIL knows the difference between an entry and a continuation. When a new session starts, it fires a landing_page_view_event dataLayer event — the true beginning of a user visit.


Subsequent navigations within that same session trigger a lightweight page_view_event dataLayer event.


This restores proper funnel visibility and prevents conversions from being tied to “(not set)” landings.


Self-healing and rehydration


When a user reactivates a tab, the SIL instantly re-establishes context — firing a session_expired_page_view event, refreshing its cookie, and resyncing with GA’s new session ID. This all happens client-side, silently, through the same dataLayer GA4 already uses.


Hybrid attribution continuity


If a user stays on the same page and reactivates it within two hours of a campaign visit, The SIL intelligently reuses the previous campaign source and medium to maintain a continuous attribution story.


If more than two hours have passed — or if the user navigates elsewhere — the system resets to Direct / None, ensuring all data remains both accurate and temporally consistent.



Why this matters


For businesses, the Session Integrity Layer isn’t just a technical improvement — it’s a shift in trust.


When your analytics finally match how people actually behave, everything downstream improves:

SIL advantage

Business outcome

Accurate session boundaries

True conversion rates, no double-counting

Consistent landing data

Reliable attribution and funnel analysis

Channel clarity

Marketing spend tied to actual behaviour

Privacy-first design

100% compliant with consent policies

Drop-in deployment

Runs entirely via Google Tag Manager, no backend changes

In practice, it means campaign performance data becomes believable again.


“Direct” traffic stops absorbing campaign sessions, and leadership teams can finally trust what they’re seeing.



From patch to platform


What began as a simple script that reconstructed UTM parameters has evolved into a full analytics intelligence layer — a bridge between user behaviour and GA4’s event engine.


The SIL operates as a GA-synchronised session governor: watching GA’s heartbeat, re-hydrating sessions when they expire, and keeping everything consent-safe, lightweight, and client-side.



A quiet revolution in measurement


The Session Integrity Layer doesn’t replace GA4 — it makes it smarter. It restores continuity, context, and truth to session-based analytics.


For teams who make decisions from data, that means fewer blind spots, cleaner attribution, and confidence that every insight starts from reality, not assumption.



In one line

The Session Integrity Layer turns GA4 into a self-healing, consent-aware analytics engine that finally understands sessions.

Laptop displaying analytics with "GA4" and "1,250" text, featuring graphs and pie charts in blue and orange on a white background.

Your analytics should tell the whole story — not just part of it.


I’ve spent years inside analytics platforms and client setups, watching teams make six-figure decisions based on data that doesn’t actually represent what users did.


The Session Integrity Layer is the result of that experience — a practical fix born out of frustration with how fragile measurement has become.


My service is to work directly with marketing and analytics teams to implement this, align it with their consent setup, and make sure GA4 finally reflects what’s really happening on their site.


But the real benefit goes beyond cleaner data. It’s about understanding.


When your team sees how GA4 sessions actually behave — when you watch broken attribution paths reconnect in real time — you start to think differently about campaigns, reporting, and optimisation.


If you’ve ever questioned “Direct” spikes, missing landings, or attribution gaps, you’re already seeing the symptoms that the SIL solves. Get in touch and let’s explore how session-aware measurement can restore accuracy to your data.


📩 Contact me here to start the conversation.


 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page