Categorizing data into users and sessions

Let’s look at the first few steps in which Google Analytics processes data.

  • First, Analytics determines new vs. returning users.
  • Then it categorizes hits into session (or periods in which the user engaged with the site).
  • Next, it joins data from the tracking code with other data sources. 

New vs. Returning Users

In the first step, Google Analytics differentiates new from returning users. When a user arrives on a page with tracking code, Google Analytics creates a random, unique ID that gets associated with the user’s browser cookie. Analytics considers each unique ID to be a unique user. Every time a new ID is detected, Analytics counts a “new user” and sends it over with the hit. When Analytics detects an existing ID, it sends a “returning user” value with the hit.

There are a couple of limitations to note about differentiating users. Since Analytics uses a browser cookie to determine unique users over a given session, this information will be lost if a user clears or has blocked that cookie in their web browser. If a user clears their browser cookies, Google Analytics will set a new unique ID the next time a browser loads a tracked web page. Analytics will then count that user as “New,” rather than “Returning.”

Google Analytics can identify users over multiple sessions, as long as the sessions happen in the same browser on the same device. Analytics doesn’t recognize users who visit your website from different devices by default and will count each device as a unique user. If you wish to track users across devices, you’ll need to turn on the User ID feature, which we’ll cover later.

Defining Sessions

Next, in order to understand a user’s level of engagement with a website, Google Analytics groups user hits based on the time in which they were generated. To measure these periods, Analytics uses a metric called “sessions.”

Remember that on websites, a session begins when a user navigates to a page that includes the Google Analytics tracking code and generates a “pageview” hit. It will end after 30 minutes if no other hits are recorded. If a user returns to a page after a session ends, a new session will begin.

Let’s look at a few examples of how hits can be organized into sessions.

For our first example, If a user visited the homepage of the Google Merchandise Store and then left immediately without clicking on anything, Google Analytics will record one “pageview” hit for that user in a single session.

But let’s take a look at a second example: A user lands on the homepage of the Google Merchandise Store. The session begins with a “pageview” hit. Then the user clicks the play button for a video that is being tracked with event tracking. This triggers an “event” hit. Google Analytics will record two hits for that user in that session: a “pageview” hit for the home page, and an “event” hit for clicking the play button.

In a third example, a user visits the store and lands on the homepage. They immediately open a new tab in their browser to view another website and they spend more than 30 minutes on that site. Then they go back to the tab with the Google Merchandise Store and click the play button on the video. Google Analytics will record two separate sessions for that user.

The first session will include a “pageview” hit and the second session will include an “event” hit, since the first session will have timed out, while the user was viewing the second tab.

While sessions time out after thirty minutes of inactivity by default, you can change this setting in your configurations to better align with user behavior on your site. For example, a site with a goal to get users to watch videos may not want sessions to timeout after thirty minutes. They can extend session timeout to the average watch time of the videos on the site. Click the link at the end of this lesson to view instructions for changing the default session timeout.

Once Google Analytics has organized data by session, it can calculate a number of the metrics that show up in your reports such as sessions, pages per session, average session duration, and bounce rate.

Joining Google Analytics data with other sources

In the third step of processing, Google Analytics will join the data collected by the tracking code with other sources that you’ve specified. Let’s look at two ways to add data from external systems using the measurement protocol and linking to other Google accounts. 

The measurement protocol lets you send data from any web-connected device like point-of-sale systems or web-connected kiosks to Google Analytics. Unlike the tracking code which sends hits automatically, if you want to collect data from a system outside of Google, you must pass the data collection hits manually in a URL string.

The measurement protocol defines how to construct your hits using a customized tracking ID and send those hits to your designated Google Analytics account. You can find more information about the Measurement Protocol in the Analytics Developer documentation linked at the end of this lesson.

Google Analytics can also link data from other Google marketing tools like Google Ads, AdSense, or the Google Search Console.

This allows information like Google Ads clicks, impressions, and cost data to be viewed in your Analytics account.
These are the first three steps Google Analytics takes when processing data. Watch the next video to see how Analytics finishes processing data.
 

Was this article helpful?
How can we improve it?