0% found this document useful (0 votes)
16 views

How Google Analytics Collects Data

Google Analytics collects data through a snippet of JavaScript tracking code installed on every webpage where data is wanted. This code sends a "hit" to Google Analytics containing information about each user interaction, such as the page viewed, events triggered, or transactions made. Common hit types are pageviews, events, and transactions. Google widens the data from the hits using additional sources like IP addresses and browser/device details to provide dimensions for detailed reporting in Google Analytics.

Uploaded by

Rosalie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

How Google Analytics Collects Data

Google Analytics collects data through a snippet of JavaScript tracking code installed on every webpage where data is wanted. This code sends a "hit" to Google Analytics containing information about each user interaction, such as the page viewed, events triggered, or transactions made. Common hit types are pageviews, events, and transactions. Google widens the data from the hits using additional sources like IP addresses and browser/device details to provide dimensions for detailed reporting in Google Analytics.

Uploaded by

Rosalie
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

How Google Analytics collects data

Introduction
Hi, I’m Justin Cutroni. And I’m Krista Seiden. We’re Analytics Advocates at Google. Welcome to Advanced Google
Analytics. If you’ve already taken our course Google Analytics for Beginners, you should be well prepared to take
this next step in your understanding of Analytics.

Website data collection


Let’s start by showing you some speci cs on how Google Analytics collects data. Remember that website data
collection begins with a snippet of JavaScript tracking code that’s included on every web page of the site where
you want to collect data. The goal of the tracking code is to track each user interaction that occurs on your
website. These interactions can be as simple as loading a page or something more speci c like clicking a video
play button or a link.

The Analytics tracking code uses the domain of the website you are tracking to de ne it as a “site” in your reports.
With the tracking code installed, Google Analytics will drop a cookie in the user’s browser for that website and any
related subdomains. This makes it easy to track tra c on a single website URL domain or subdomain by default.

Note that if you install the same default tracking code on pages with different domains, Analytics will
count these users and sessions separately. If you need to track users across different domains, you will
need to set up cross-domain tracking, which we’ll discuss later.

Anatomy of a "hit"
With each user interaction on your website, the Analytics tracking code sends what’s called a “hit” to Google
Analytics. A “hit” is a URL string with parameters of useful information about your users. It looks something like
this:

If we break down the URL string, you can see that it’s passing some useful information to Analytics about the user
that triggered the hit. For example, we can see things like:

• the language the user’s browser is set to


• the name of the page they’re viewing
• the screen resolution of the user’s device
• and the Analytics ID that associates that hit to the correct Analytics account.
This is just some of the information passed in the hit, depending on the user interaction with the site and what is
being tracked. The hit will also include other information like a randomly-generated user identi er. This will allow
Google Analytics to differentiate between new and returning users.

The three most common types of hits are:

• “pageview” hits
• “event” hits
• and “transaction” hits
A “pageview” hit is triggered when a user loads a webpage with the tracking code. This is the most common type
of hit sent to Analytics. Every time a user opens a page with the tracking code, a new pageview hit will be sent.

An “event” hit lets you track every time a user interacts with a particular element on your website. For example,
you can track whether users click a video Play button, a particular URL, or a product carousel. Event hits pass four
parameters of data in the URL: event action, category, label, and value. You can use these to categorize
interactions in reports that are speci c to your website. We’ll go into more detail on event tracking a little later.

A “transaction” hit (also called an “ecommerce” hit) can pass data to Analytics about ecommerce purchases such
as products purchased, transaction IDs, and “stock keeping units” (or SKUs).

If you’ve set up Enhanced Ecommerce within Google Analytics, you can also pass additional ecommerce data like
product category, whether items have been added or removed from a shopping cart, and how many times users
viewed a product on a website.

There are additional hits such as “social hits” that can pass likes, shares, or tweet data; and “page timing hits” that
allow you to report on page timings, but the Pageview, Event, and Transaction hits are the three most common.

We’ve discussed some of the information passed in hits such as Language and Page Title. But Google Analytics
widens that data using other sources such as IP address, server-log les, and other ad-serving data. Using this
additional information, Analytics can understand things like:

• a user’s location;
• speci cs about their browser and operating system;
• their age and gender;
• and the source/medium that referred them to a site.
You’ll recognize many of these parameter names passed in the hit or widened with additional data because they
get turned into the dimensions that make up your reports in Google Analytics. Remember that dimensions are just
ways to categorize metric data like all the metrics for a speci c “country” or “device type.”

Once the hit is sent to Google Analytics and combined with additional data, all of this information is ready for
processing by the Analytics servers. Understanding how Analytics collects and processes data can help you
better understand your reports and what the data means.

You might also like