When Does a Google Analytics Session Expire?
You see the "Sessions" metric in your Google Analytics reports every day, but what does it really represent? Most people assume a session is just one person visiting their site, ending when they close the browser tab. While that’s close, the reality is a little more specific, and understanding it is fundamental to making sense of your user behavior data. This article breaks down exactly how GA4 defines a session, the three main ways a session expires, and how you can even customize these settings to better fit your website.
What's a "Session" in Google Analytics?
Think of a session as a container for all the actions a user takes on your website during a single visit. It begins the moment someone lands on your site - whether through social media, a Google search, or by typing your URL directly. Every interaction they have from that point on is bundled into that single session.
These interactions, or "events" in GA4 lingo, can include:
Viewing a page
Clicking a link
Watching a video
Filling out a contact form
Adding an item to a cart
Making a purchase
A single user can have multiple sessions over days, weeks, or months. Understanding how and when those sessions end is critical because it directly impacts many other metrics you rely on, like engaged sessions, session duration, and conversion rates. An artificially high session count caused by frequent timeouts can skew your data and lead you to incorrect conclusions about your site's performance.
The 3 Ways a Google Analytics Session Ends
While the old "closing the tab" method is what most people picture, Google Analytics doesn’t actually know when a user has closed their browser. Instead, it relies on three clear rules to determine when one session has ended and a new one should begin.
1. Time-Based Expiration (The 30-Minute Rule)
This is the most common reason a session ends. By default, a Google Analytics session will expire after 30 minutes of user inactivity. It's important to focus on the word "inactivity." This doesn't mean 30 minutes after they arrive, it means 30 minutes since their last interaction.
Each time a user triggers an event - like clicking to another page or playing a video - the 30-minute expiration clock resets.
Example in action:
10:00 AM: A visitor lands on your blog post from a search result. Their session starts, and the 30-minute timer begins.
10:05 AM: After reading for a few minutes, they click a link to another article on your site. The timer resets.
10:10 AM: They scroll down the new page and click play on an embedded video. The timer resets again.
10:15 AM: They finish the video and get a phone call, leaving the tab open. The inactivity countdown begins now.
If that user comes back at 10:40 AM (25 minutes later) and clicks on your "About Us" page, they are still within the same session because they didn't exceed the 30-minute idle window. The timer simply resets once more.
However, if they come back at 10:50 AM (35 minutes later) and click a link, their original session will have expired. Google Analytics closes out the first session and immediately starts a new one.
2. End of Day Expiration (The Midnight Rule)
This rule is simple but can sometimes cause confusion. Every session automatically ends at midnight - specifically, 11:59:59 PM. The time is based on the timezone configured in your Google Analytics property settings.
This means if a user is actively browsing your website when the clock strikes twelve, their session is cut off and a new one begins on the next event after midnight without them doing anything different.
Example in action:
11:50 PM: A user lands on your e-commerce store and starts shopping. Session #1 begins.
11:58 PM: They add a product to their cart.
12:02 AM: They continue shopping and click to view another product category. Session #1 ended at midnight, and this new page view triggers the start of Session #2 for the new day.
For most websites, this has a minimal impact. But for global businesses, gaming sites, or entertainment platforms with significant late-night traffic, you might see a spike in session counts around the midnight mark.
3. Campaign Source Change
This rule is especially important for marketers who are tracking campaign performance. A session will automatically end if a user comes to your site through one campaign, leaves, and then immediately comes back through a different campaign.
What defines a "campaign"? A change in any of the primary source dimensions, such as:
Source (e.g.,
googlevs.facebook)Medium (e.g.,
organicvs.cpc)Campaign Name (e.g.,
utm_campaign=summer_sale)Term (e.g.,
utm_term=data_analytics_tools)Google Ads Click ID (gclid)
GA4 does this to properly attribute conversions and user behavior to the correct marketing channel. It prevents a single session from being credited to multiple campaigns, which would make attribution a mess.
Example in action:
A user clicks a link in your email newsletter (
utm_source=newsletter) and lands on a product page. They browse for five minutes. (Session #1 begins).They decide not to buy and navigate away to a news website, keeping your product tab open.
Later, they see one of your Google retargeting ads (
utm_source=google,utm_medium=cpc) for the exact product they were viewing. They click the ad.Because they returned through a new campaign source, their original session ends, and an entirely new session (Session #2) begins. Any purchase they make now will be credited to the Google Ads campaign, not the email newsletter.
Common Questions about GA4 Session Expiration
Does closing a browser tab or window end a session?
No, not directly. Closing the browser doesn't send a signal to Google Analytics. The session remains "alive" until one of the three conditions above is met. If a user closes your website's tab and comes back 15 minutes later by typing your address in, GA4 will resume the original session. The 30-minute inactivity timeout is what technically ends the session in this scenario.
What if someone has my site open in multiple tabs?
Google Analytics considers all activity from a single user within the same time frame as part of one session. If they have your homepage open in one tab and your blog in another, as long as they interact with either tab before the 30-minute timeout is reached, the single session continues.
How is a session different from a user? Or an event?
It helps to think of it hierarchically:
User: The individual person visiting your website.
Session: A single visit made by that person.
Event: A specific action taken during that visit.
One user can have many sessions over time. One session can have many events inside of it.
Creating the Session Timeout in GA4
The default 30-minute timeout works for most websites, but it’s not always a perfect fit. You have the ability to adjust this setting to better match how users naturally interact with your content.
Consider increasing the timeout duration if:
Your site features long-form content, like in-depth articles, case studies, or tutorials, that might require more than 30 minutes to read.
You host long videos or webinars directly on your page. A user could be actively engaged watching a 60-minute video, but GA4 would see them as "inactive" and split their engagement into two separate sessions.
Your product is a web application where users might spend a lot of time on a single screen entering data or configuring settings without triggering new events.
On the other hand, you might want to decrease the timeout duration if your website is designed for quick, transactional interactions where a user is expected to be in and out in minutes.
How to Adjust the Session Timeout
Changing this setting in GA4 is straightforward:
From your GA4 dashboard, go to Admin (the gear icon in the bottom-left).
In the Property column, click on Data Streams.
Select your website's data stream.
Scroll down and click on Configure tag settings.
Under the Settings section, click Show more if the option is hidden.
Click on Adjust session timeout.
Here, you can set the hours and minutes for your session timeout, anywhere from 5 minutes to 7 hours and 55 minutes. You can also adjust the timer for 'Engaged sessions.'
Hit Save when you're done.
A word of advice: Try not to change this setting too often. Consistency is vital for comparing your traffic data month over month. Pick a time that makes sense for your business and stick with it to ensure your trend analysis remains accurate.
Final Thoughts
In short, a Google Analytics session ends in one of three ways: 30 minutes of inactivity, the clock hitting midnight, or the user returning through a different marketing campaign. Understanding these rules moves you from just reporting on metrics to truly understanding what your data is telling you about user behavior and campaign effectiveness.
Connecting data from Google Analytics with everything else - like your ads manager, CRM, and e-commerce platform - can quickly become overwhelming. This is exactly why we built Graphed. Instead of manually pulling reports and trying to stitch them together, you can connect your marketing and sales data sources one time. Then, just ask questions in plain English like, "create a report showing sessions from Google Ads versus revenue from my Shopify store for last quarter." Instantly, you get a real-time dashboard with the answers you need, saving you hours of busywork. Try Graphed and start focusing on insights, not spreadsheets.