Chapter 3. Under the Covers: How Google Analytics Works

Understanding the Google Analytics architecture—how it collects data, processes data, and creates reports—is the key to understanding many of the advanced topics that we will discuss later in this book. Google Analytics can collect data from a number of different platforms using different tracking technologies, which makes things complicated.

Google Analytics is no longer a simple “hit collector” for websites, but rather an information aggregation system that collects data from standard websites, mobile websites, Adobe Air applications, and iPhone and Android apps. Google has progressively added more data collection methods as technology has driven new and different ways of distributing content to people.

In this book, we will primarily focus on tracking websites, but I will briefly discuss the other tracking methods as well. Let’s start with the simplest configuration: tracking a website.

Data Collection and Processing

Figure 3-1 shows how Google Analytics collects, processes, and displays data.

Google Analytics uses a common data collection technique called page tags. A page tag is a small piece of JavaScript that you must place on all the website pages you want to track. We affectionately call this code the Google Analytics Tracking Code, or GATC for short. If you do not place the code on a page, Google Analytics will not track that page.

The data collection process begins when a visitor requests a page from the web server. The ...

Get Google Analytics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.