Google Analytics – Sessions vs Hits: Know The Differences & The Hierarchy

Hierarchy of Users, Sessions & Hits

Last Updated on October 10, 2020 by Ritwik B

Let’s try to understand the relation between the “session” & “hit” terms in Google Analytics.

In this article, we’ll explain some of the key concepts about ‘Session’ metrics & hope to answer some questions like:

  • What is a google analytics session?
  • What is interaction and non-interaction hit?
  • Why are my %new sessions are higher than 100%?
  • How can I start and end the session manually?
  • & more

Index

What is a 'Session' & 'Hit' in Google Analytics?

As per google documentation,

A session is a group of user interactions with your website that take place within a given time frame.

The period of time a user is active on your site or app. By default, if a user is inactive for 30 minutes or more, any future activity is attributed to a new session. Users that leave your site and return within 30 minutes are counted as part of the original session.

Notice the two texts bolded in the above definition..??

If you try to grasp these, then you’ll have a clear understanding of the session metric. Let’s look at these bolded texts:

1.) Group of user interactions:  It simply means that the interaction hits (=user interactions)  are the once that are taken into account while computing sessions (& its dependent fields).

2.) Given time frame: It means that the session metric is time-dependent.

Now the next question you might be wondering is “What is an interaction hit?”

To get a clear picture of what hits are in the google analytics, let’s look at its definition

“A Hit is an interaction that results in data being sent to Analytics.”

Each time the tracking code is triggered by a user’s behavior (for example, user loads a page on a website or a screen in a mobile app), Analytics records that activity. Each interaction is packaged into a hit and sent to Google’s servers.

These hits are categorized as:

  1. Interaction Hits.
  2. Non-Interaction Hits.

They are further grouped into the following hit types. By default, most of these are interaction hits.

Google analytics hit types

Understanding Interaction vs Non-Interaction Hits

Only Interaction Hits are taken into account for calculating “Sessions” and its dependent metrics such as:

  • Session Duration
  • Pages/Session
  • Avg. Session Duration
  • % New Users
  • Bounce Rate
  • etc

And If it is a non-interaction hit, then it is excluded from the computing session. (& its dependent metrics.)

You can simply convert an interaction hit like pageview or event hit to a non-interaction hit by adding the following line. (make sure you add it before sending a pageview)

ga('set', 'nonInteraction', true);

If you’re using a measurement protocol, then you can simply add a “ni” parameter and set its value to 1.

EXPERIMENT:

I have fired 2 non-interaction pageview hits and 3 interaction page view hits. (both being different users)
Then, I have created 2 segments for these 2 users & 1 segment combining both the users naming Interaction + Non-Interaction hits.
Let’s see what we got in Google Analytics Overview Report:

Interaction_Non_InteractionHits

OBSERVATIONS:

So, the interaction hits resulted in 1 session while the non-interaction hits resulted in 0 sessions.
Notice how the metrics in the combined (Interaction & Non – Interaction) segment are reported. That would actually be the overall All users data you see every day.

  • Users get counted in Non-interaction Hit but Session doesn’t.
  • Avg. Session Duration, Pages / Sessions, Bounce Rate ignore the non-interaction hits. But due to page views being counted in the non-interaction hit, the overall pages/session metric is actually Pageviews (All Hits) / Sessions (Interaction Hits).
  • %New Users is actually New Users (All Hits) / Sessions (Interaction Hits), so remember if you have encounter such a situation where it is greater than 100%.

Effect On Other Session Related Metrics Like %New Session, Pages/Session & more...

As we observed in the previous example, these hits affect a lot in how these ‘session’ related metrics are calculated. We’ll look at these metrics one by one:

1.) % New Sessions:

It is defined as New Users / Sessions.

Now remember from the last example, ‘Users’ are incremented for all hit types (Interaction+Non-Interaction), but sessions are only counted for Interaction hits.

So there might be a case where Users are higher than  Sessions & that results in %New Users > 100%

2.) Pages / Sessions

It is defined as Pageviews / Sessions

Here’s pageviews are counted both for Interaction & Non-Interaction Hits, while Sessions is just interaction hits.

So there may be a case where Pageviews are much higher than the sessions.

3.) Bounce Rate: As per google,

A Bounce is defined as a session containing only one interaction hit.

and Bounce Rate is defined as Bounces / Sessions.

So you can see that only interaction hits are taken into account for Bounce Rate computation. You can even adjust the bounce rate by setting the hits to non-interaction.

Google Analytics Hierarchy - Users, Sessions & Hits.

Now let’s look at the hierarchy between Users, Sessions & Hits in Google Analytics.

Hierarchy of Users, Sessions & Hits

The session-level comes in between the user and the hit level. To understand Users more clear, you can check Google Analytics – Users – Metric Simplified, where I have explained about the ‘user’ metric and how they are calculated in analytics.

EXPERIMENT:

Let’s understand the hierarchy through a live example, I have created the segment of my clientId naming Ritwik’s browser.

Date Range is Jan – 17:

User_Session_Hit_Level_Google_Analytics

OBSERVATIONS:

As you can see, I visited the site for the first time on 9th Jan 2017 and had a total of 11 sessions. Let’s understand some key points here:

  • The User level is at the top of the hierarchy. So you can see that there is only one user here (i.e my browser).
  • A Unique user can have ‘one or more’ sessions. As you can see my browser had 3 sessions on the 9th, 3 on the 10th, on the 11th,…… and so on. This is the session-level.
  • A Unique session can have ‘one or more’ pageviews. This is the hit level.

Here the user level is actually the browser level. If you change you device or browser or clear cookies,etc you will be treated as a new user. You can set up a user id tracking feature in analytics (more on this later) and that dimension will be at the top of the hierarchy given above.

You can also check Google Analytics – Users – Metrics Simplified to understand more about the users metric and why it is not additive (after applying secondary dimension) but the sessions and pageview metrics are.

Session Control: Starting/Stopping The Sessions Manually

You are free to decide when you want to start a session and end it. Let’s say, you have a blog within your website. Whenever someone enters your blog site (blog.example.com) you can start the new session.

So, you can also control the Avg. session duration metric by starting and stopping the sessions at particular hits. You can use ‘start’ and ‘end’ values for session control in a hit. The pageview hit code for starting the session is as follows:

ga('send', 'pageview', {'sessionControl': 'start'});

EXPERIMENT:

Let’s take an example.

I viewed 4 pages in a sequence :

  1. /sessions-start.html
  2. /session-start2.html
  3. /session-start3.html
  4. /session-start4.html

On the last second page, (/session-start3.html) I fired new session through the pageview hit.

GoogleAnalyticsSessionStartAndStop

OBSERVATIONS:

  • As you can see, the new session started on /session-start3.html page, as it became the new landing page. Also, metrics that depend on the sessions like Avg. Session duration, Pages/Session, Bounce Rate, etc are calculated differently for both the session.
  • As session control code fires at a collection phase, you cannot experiment it on a test view separately. But you can do so in test property.

You can always experiment and come up with new use cases for your website.

FAQs

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.

Each time the tracking code is triggered by a user’s behavior (for example, the user loads a page on a website or a screen in a mobile app), Analytics records that activity. Each interaction is packaged into a hit and sent to Google’s servers.

“A Hit is an interaction that results in data being sent to Analytics.”

Each time the tracking code is triggered by a user’s behavior (for example, user loads a page on a website or a screen in a mobile app), Analytics records that activity. Each interaction is packaged into a hit and sent to Google’s servers.

You can start & end a session in google analytics by manually entering the following code:

To start the Session: ga('send', 'pageview', {'sessionControl': 'start'});

To end the Session: ga('send', 'pageview', {'sessionControl': 'end'});

Ritwik is a product owner at DigiXport. He also loves to write technical & easy to understand blogs for Marketers & Entrepreneurs. A Firm Believer in Teaching -> Learning -> Growing. :)

Leave a Reply

Your email address will not be published. Required fields are marked *