You cannot change the default session timeout duration in Google Analytics.
A session is a group of interactions that take place on your website within a given time frame. By default, a session lasts until there’s 30 minutes of inactivity, but you can adjust this length so a session lasts a few seconds or several hours. A session can be as short as a few seconds or as long as several hours. A single user can open multiple sessions.
Read more here: https://support.google.com/analytics/answer/2731565
The concept of a session in Analytics is important to understand because many features, reports, and metrics depend on how Analytics calculates sessions.
A session is a group of user interactions with your website that take place within a given time frame. For example a single session can contain multiple page views, events, social interactions, and ecommerce transactions.
You can think of a session as the container for the actions a user takes on your site.
A single user can open multiple sessions. Those sessions can occur on the same day, or over several days, weeks, or months. As soon as one session ends, there is then an opportunity to start a new session. There are two methods by which a session ends:
- Time-based expiration:
- After 30 minutes of inactivity
- At midnight
- Campaign change:
- If a user arrives via one campaign, leaves, and then comes back via a different campaign.
Time based expiration
How long does a session last?
By default, a session lasts until there’s 30 minutes of inactivity, but you can adjust this limit so a session lasts from a few seconds to several hours.
When a user, say Bob, arrives on your site, Analytics starts counting from that moment. If 30 minutes pass without any kind of interaction from Bob, the session ends. However, every time Bob interacts with an element (like an event, social interaction, or a new page), Analytics resets the expiration time by adding on an additional 30 minutes from the time of that interaction.
Assume Bob interacts with your website at the following intervals:
After event 2, the session expiry is set to 14:34
When Bob first arrives on your site, the session is set to expire at 14:31. As Bob continues through your site, viewing pages and triggering events, each of these additional requests moves the expiry ahead 30 minutes.
What happens if during a session to my site, Bob leaves open a page while he takes a 31-minute lunch break, then returns to continue browsing the site?
In this scenario, the first session that was opened when Bob arrived on the site ends 30 minutes into his lunch break. When he returns from lunch and continues browsing the website, then Analytics sets a new 30-minute expiry, and a new session begins.
Bob was half way through a product purchase when he left your site and went for lunch. He later returned to complete the transaction. The landing page of the new session is the add-to-cart page.
What happens if Bob leaves open a page on my site, but only takes a 29-minute lunch break before he continues browsing?
When Bob returns, the session that was open continues from the last page he was viewing on your site (provided he doesn’t return via another campaign source — a bit more about this below). As far as Analytics is concerned, he never left your website.
Bob was half way through a product purchase when he left your site and went for lunch. The difference this time is that because he returned in under 30 minutes, the old session remains open. It’s worth noting that his time on page for pageview 2 (product) is 29 minutes, since time on page is calculated as the difference between the initiation of successive pageviews: pageview 3 – pageview 2 (14:31-14:02 = 00:29).
- You Cannot Change The Default Session