In order to properly understand the data you'll be working with in Google Analytics,
it's important to have a high level overview of how the data is collected and processed
before you see it in the reports.
There are four main components to the Google Analytics system:
the data collection, the configuration, the data processing and reporting.
We will review each of these components in detail
and how they work together to generate the data you need.
Let's start with collection.
You can use Google Analytics to collect user-interaction data
from websites, mobile applications and really any digitally connected environment that you
want to track,
like a kiosk or a point-of-sale system.
We'll focus on the basics of website tracking first.
To track a website Google Analytics uses a small piece of JavaScript code to collect
information.
You must place this piece of code on every page of the website.
When a user arrives at your website this JavaScript code
will begin to collect various pieces of information about how the user engages with your site.
First, the JavaScript can collect information from the website itself,
like the URL of the pages that the user is viewing.
Second, it can collect information from the user's browser,
like the language the browser is set to, the browser name
and the device and operating system used to access the site.
Third, the JavaScript can collect information from the referring source
that brought the user to the site in the first place.
All of these pieces of information are packaged up
and sent to Google's Analytics servers to await processing.
One package of information is usually referred to as a "hit" or an "interaction."
Keep in mind that every time your user visits a new page on your site,
the JavaScript code will collect and send new or updated information about the user's
activity.
An incredible amount of data can be collected by Google Analytics
just by using the standard JavaScript tracking code.
But, keep in mind that there are many possible customizations
that will allow you to collect additional data
that you may have identified during your measurement planning process.
For example, if you run a loyalty program for your airline,
you might want Google Analytics to keep track of your customers' frequent flyer status
by collecting this information when a user logs on to your website.
It is possible, using additional JavaScript code, to collect this data
and send it back to Google Analytics servers with the rest of your user-interaction data.
Conceptually, collecting data from mobile applications with Google Analytics
is very similar to tracking websites.
However, there are a few key differences in the collection process that you should be
aware of.
First, instead of using JavaScript code to collect data,
mobile app tracking uses a different set of methods.
These methods are specific to the operating system of the device.
Rather than automatically capturing data on each "pageview,"
mobile app tracking collects data after each "activity."
You must add extra code to each "activity" you want to track.
One unique aspect of mobile app tracking
is that mobile devices are not always connected to the internet.
As a result, data can not always be sent to the collection servers in real time.
To handle this situation, Google Analytics can store the "hits"
and dispatch them to the servers when the device reconnects to the internet.
Collecting data from digital environments besides websites and mobile applications
requires the assistance of a knowledgable developer.
Conceptually, the collection process isn't much different than from what's already been
discussed.
In the web tracking scenario,
a "hit" is sent every time a user views a page tagged with Google Analytics.
In the mobile app scenario,
a "hit" is sent every time a user completes an activity that's been tagged with Google
Analytics.
So, to implement Google Analytics in another digital environment,
you have to simply choose what type of user interaction you consider a "hit" for that
specific environment.
For example, if you wanted to track your in-store purchases
you could have your point-of-sale system send a "hit" every time a purchase is complete.
That "hit" could include information
like the store location, the items purchased, the purchase date and so on.
Regardless of where you're collecting data from,
once the hits from a user have been collected on Google's servers,
the next step that occurs is data processing.
You can think of processing as the transformation step
that turns your raw data into something more useful.
For example, during data processing we categorize your users devices as mobile or non-mobile.
In this step, Google Analytics also applies your configuration settings to the raw data.
For example, you can choose to add filters to your data.
A filter can include or exclude certain types of data from your reports,
like excluding data from your own internal users.
Once your data is processed, taking into account your configuration, the data is stored in
a database.
It's important to note that once the data has been processed
and inserted into the database it can't be changed.
The final component of the Google Analytics platform is reporting.
Typically, you will use the web interface at google.com/analytics to access your data.
However, it is also possible to systematically retrieve data from your Google Analytics account
using your own custom application code and the Core Reporting API.
In summary, in this lesson we talked about how Google Analytics works
and the four main parts of the system:
data collection, data processing, configuration and reporting.
For more technical details about how Google Analytics works,
check out our developer resources.