Google Analytics Sessions Tutorial

How does Google Analytics define a session?

In Google Analytics, a session is a group of hits recorded for a user in a given time period.

A hit is a user’s interaction (pageview, screen view, event, transaction, etc) with your website that results in data being sent to the Google Analytics server.

A single session can contain multiple hits. You can call a session a container that contains multiple hits for a given time period.

google analytics sessions session

A user can generate one or more sessions in a single day or over several days, weeks, or even months.  

The session begins as soon as the user lands on the website and the session may expire after 30 mins from the last hit sent or it may expire at midnight or if the campaign source changed.

All Google Analytics sessions have got an expiry date and they can’t last longer than 4 hours. We will talk about how the session expires later in this article.

Why it is important to track sessions in Google Analytics

Tracking sessions in Google Analytics help you discover and evaluate your user behavior and website performance, which eventually helps you understand your marketing efforts.

Let’s suppose you have 2 to 3 sessions per user on average which mean you are successfully attracting users to your website through your marketing campaigns. But, if you do not have enough sessions per user, it might indicate either your marketing efforts are not attracting the users or your website is having some issues.

With session tracking you get answers to many questions, for example, if you have an ecommerce website you will get to know meaningful insights, such as:

  • How many times session had a goal conversion?
  • How many session leads drop off from the purchase funnel?
  • How many times session had an “add to cart” event?
  • How many time sessions lead to the transaction?
  • How many times did the session contain checkout activities?

You can find all this information in ecommerce reporting.

google analytics sessions ecommerce report

The difference between web sessions and Google Analytics sessions

A web session is a series of HTTP requests and HTTP responses exchanged between a web browser and a web server in a given time period. All web browsers and web servers communicate with each other by sending HTTP requests and HTTP responses. 

A web browser communicates with a web server by sending an HTTP request for each requested resource. The requested resource could be an HTML document, an image, a CSS file or JavaScript file, etc. The web server communicates back to the web browser by sending an HTTP response for each HTTP request.

A Google Analytics session is not a series of HTTP requests and HTTP responses exchanged between a web browser and a web server in a given time period. It is a group of hits recorded for a user in a given time period.

So web sessions and Google Analytics sessions are not the same things. It is important that you understand this difference. This way, when you talk to your developer, they will not get confused.

For a web developer, a session usually means a web session. So if you are referring to a Google Analytics session then you may need to explain the difference between a web session and a Google Analytics session to your developer.

62 point checklist

Get the E-Book (50 Pages)

 

Google Analytics 4 thumb

Get the FREE E-Book (50+ Pages)

When does a Google Analytics session expire?

Time-based expiration

By default, a GA session expires if no new hit is sent to the GA server within 30 minutes from the time when the last hit was sent. 

In layman’s terms, we call this period of no new hit sent as ‘no user’s activity on a website.

Let’s take an example. Suppose you visited a website at 15:00, Google Analytics starts counting 30 minutes from the first hit. If you do not interact with the website for the next 30 min then your session will be terminated at 15:30.

But for every interaction (event, pageview, or a transaction) after the first hit, Google Analytics will reset the 30 minutes countdown from the last interaction. So if you have done the last interaction at 15:02, your session countdown will be rest to expire at 15:32.

google analytics sessions session

Now let’s look at the above image:

  • The user visited the website and the first interaction (pageview 1) happened at 15:00, where Google Analytics has set the session expiry at 15:30
  • The next hit was again a pageview 2 happened at 15:02, where Google Analytics has reset the session expiry at 15:32
  • The third hit was an event that happened at 15:10, where Google Analytics has reset the session expiry at 15:40
  • The fourth hit was again an event that happened at 15:15, where Google Analytics has reset the session expiry at 15:45
  • The final hit was a pageview that happened at 15:20, where Google Analytics has reset the session expiry at 15:50

After the last pageview hit, the user did not interact with the website, and hence even though the session started at 15:00, the last interaction happened at 15:20 and hence the session will expire after 30 minutes of inactivity at 15:50.

Now you might be thinking what if the user started the session, leaves the page open after few hits, and returns to continue browsing after a break of more than 30 mins.

In this scenario, let’s suppose the first session hit happened at 15:00, here Google Analytics will set session expiry at 15:30. Now the second hit happened at 15:02, here Google Analytics will reset the session expiry at 15:32. But after that, the user leaves the website open and takes a break of 31 min and then continues browsing at 15:33, here Google Analytics will start a new session since the gap is more than 30 mins and the new session expiry will be set at 16:03.

google analytics sessions session 1 and 2

In another scenario let’s suppose the first session hit happened at 15:00, here Google Analytics will set the session expiry at 15:30. Now the second hit happened at 15:02, here Google Analytics will reset the session expiry at 15:32. But after that, the user leaves the website open and takes a break of 29 min and then continues browsing at 15:31, here Google Analytics will continue the existing session since the gap is less than 30 mins and the new session expiry will be set at 16:01.

google analytics sessions session 1

End of day session expiry

A GA session automatically expire at midnight (11:59:59 pm)

For example, if a user is browsing your website since 11:45 pm, his session will automatically terminate at 11:59:59 pm even if he continues to engage with your website. At 12 am a new GA session will start for your user.

End-of-day session expiry is determined by the timezone settings configuration. So if you have set up the timezone for your website of say ‘United States (GMT-07:00) Los Angeles’ the session will be terminated at exactly 11:59:59 pm according to Los Angeles time, even though if the user is visiting the website from a different time zone and different time.

Campaign-based session expiration

A GA session can also expire if a user returns to your website via a different campaign source.

The campaign source could be: search engines, referring websites, URLs with campaign parameters.

It doesn’t matter whether the user returns within 30 minutes or after 30 minutes, every time a campaign source is changed, the existing session expires and a new GA session starts.

Example-1:

If a user visits your website via organic search listing the first time but later (say after 15 minutes) return to your website via paid search ad then the return visit will end the existing GA session and trigger a new GA session, as the campaign source has changed.

Example-2:

If a user visits your website via paid search ad the first time but later (say after 15 minutes) return to your website, by again clicking on the same paid search ad and Google Ads auto-tagging is enabled then the return visit will end the existing GA session and trigger a new GA session as the campaign source has changed.

Here the campaign source changed because the GCLID value changed.

In the case of Google Ads auto-tagging, each ad click has its own GCLID value. So multiple clicks on an ad can generate multiple GA sessions.

Example-3:

If a user visits your website via paid search ad the first time but later (say after 15 minutes) return to your website, by again clicking on the same paid search ad and you are using manual tagging instead of Google Ads auto-tagging then the return visit will not end the existing GA session and not trigger a new GA session as the campaign source has not changed.

Here the campaign source did not change because the campaign tracking parameters did not change with each click on the ad.

So if you are manually tagging your Google Ads campaigns then multiple clicks on the same ad by the same user will not generate multiple GA sessions.

Example-4:

If a user visits your website via organic search listing the first time but later (say after 15 minutes) returns to your website directly then the return visit will not end the existing GA session and not trigger a new GA session, as direct traffic does not override the campaign source.

Example-5:

If a user visits your website via organic search listing the first time but later return to your website directly after 30 minutes have elapsed then the return visit will end the existing GA session and trigger a new GA session.

This happened because by default GA session expires after 30 minutes of users’ inactivity.

Example-6:

A GA session does not expire if a user navigates to another website but returns to your website within 30 minutes.

Note: An existing GA session will automatically expire if a user deletes the Google Analytics cookies.

How can a Google Analytics session last longer than 30 minutes?

Every time a new hit is sent in a GA session, Google Analytics reset the expiration date of the session by adding another 30 minutes from the time when the last hit was sent.

In this way, a session can last longer than 30 minutes.

How to change session timeout settings

By default, a session expires after 30 minutes of users’ inactivity. You can change this setting by changing the session timeout settings in your GA view.

You can make a session expire after 3 minutes of users’ inactivity or after 3 hours of users’ inactivity. However

A GA session timeout can not be less than 1 minute or greater than 4 hours.

To change session timeout settings, follow the steps below:

Step-1: Go to the ‘Admin’ section of your GA view and then click on the ‘Tracking Info’ link:

google analytics sessions tracking info

Step-2: Now click on ‘Session Settings’.

google analytics sessions session settings

Step-3: Change the session timeout settings under ‘Timeout Handling’ and then click on the ‘Apply’ button:

google analytics sessions timeout handelling

How to decide the length of a Google Analytics session for your website

The length of the Google Analytics (GA) session you choose will depend upon how much time a user spends on average on your website.

For example, if an average user spends three hours on your website to engage with your website content and/or to complete a conversion (such as complete an application form, play a game, etc.) then you should set the session timeout setting to three hours in order to match the length of time spent. 

You should not keep the default 30-minute session timeout settings if it does not accurately reflect the actual session length. 

By default, a GA session expires after 30 minutes of user inactivity. You can change this setting by changing the session timeout setting in your Google Analytics view.

You can make a session expire after three minutes of user inactivity or after three hours of user inactivity. However, a GA session timeout cannot be less than one minute or greater than four hours. 

How to force a Google Analytics session to start and end

There may be situations where you want to force a GA session to start and end depending upon the user’s activities.

For example, if your website is too big and complex to set just one session timeout setting for all website users, then you can force a GA session to start and end, in order to create different session timeouts.

You can do that by using the sessionControl configuration parameter while sending a hit.

For example, if you are using the Google Analytics tag (analytics.js) for implementation then you can use the below code.

ga(‘send’, ‘pageview’, {‘sessionControl’: ‘start’}); // start a new GA session

ga(‘send’, ‘pageview’, {‘sessionControl’: ‘end’}); // end current GA session

Here, the sessionControl configuration parameter is used to control the duration of a session. It can have two values: start and end. The value of ‘start’ forces a new session to start with a specified hit. The value of ‘end’ forces a current session to end with a specified hit.

Note: The functionality to force the Google Analytics Session to start and end is not available in global site tag (gtag.js) and Google Tag Manager.

How to measure the quality of Google Analytics sessions

You can measure the quality of a Google Analytics session in terms of closing a sale through the ‘Session Quality report’.

To learn more about this report, read this article: Understanding Session Quality data and report in Google Analytics

Why Google Analytics show zero sessions?

You may sometimes see zero sessions assigned to a page but at the same time see pageviews, user count, exits, and other metrics for the page:

google analytics sessions zero sessions

How come a page has got pageviews but is still not a part of a GA session?

How come a page has got one user but still no GA session is assigned to it?

This happened because Google Analytics assigns session count only to the first hit in a session.

You can learn more about this issue from this article: Why Google Analytics Show Zero Sessions?

Another article you will find useful: How to identify web pages with zero traffic in Google Analytics

How sessions can get affected?

There are several ways your session metrics can get affected. I have highlighted a few of them here:

Time zone

There is a high possibility that many of your users are browsing through the website late at night and Google Analytics will terminate the session at exact midnight (11:59:59 PM).

This is because Google Analytics won’t allow a session to have two dates associated with it. This affects the session data and its source of origin.

You will have two sessions one with source Google, or paid, referral, etc which was the actual source of the first session, and the other session with the page itself as a referral (if you haven’t excluded it) or direct source.

Browsing Break

Many times a user is browsing on the website and suddenly he leaves the website open and take a break. Sometimes these breaks may include a coffee break or putting your laptop on sleep mode without closing the browser. If this break is less than 30 minutes then there is no impact on the session metric but if it breaks time crosses the 30 minutes, Google Analytics will create a new session when the user continues the browsing from where he left.

Frequently Asked Questions Google Analytics Sessions Tutorial

 

What is a session in Google Analytics?

In Google Analytics, a session is a group of hits recorded for a user in a given time period. A hit is a user’s interaction (pageview, screen view, event, transaction, etc) with your website that results in data being sent to the Google Analytics server. A user can generate one or more sessions. All Google Analytics sessions have got expiry date. They can’t last longer than 4 hours.

What is the difference between a web session and a Google Analytics session?

A web session is a series of HTTP requests and HTTP responses exchanged between a web browser and a web server in a given time period. Whereas, a Google Analytics session is a group of hits recorded for a user in a given time period. So web sessions and google analytics sessions are not the same things.

When does a Google Analytics session expire?

By default, a GA session expires, if no new hit is sent to the GA server within 30 minutes from the time when the last hit was sent. In layman language, we call this period of no new hit sent as ‘no user’s activity’ on a website.

How can a Google Analytics session last longer than 30 minutes?

Every time a new hit is sent in a GA session, Google Analytics reset the expiration date of the session by adding another 30 minutes from the time when the last hit was sent. In this way, a session can last longer than 30 minutes.

How to change session timeout settings?

By default, a session expires after 30 minutes of users’ inactivity. You can change this setting by changing the session timeout settings in your Google Analytics view. You can make a session expire after 3 minutes of users’ inactivity or after 3 hours of users’ inactivity. However, a Google Analytics session timeout can not be less than 1 minute or greater than 4 hours.

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!