Analytics is the discovery, interpretation, and communication of meaningful patterns in data; and the process of applying those patterns towards effective decision making. In other words, analytics can be understood as the connective tissue between data and effective decision making, within an organization. Especially valuable in areas rich with recorded information, analytics relies on the simultaneous application of statistics, computer programming and operations research to quantify performance.

Do you want to know how Google Analytics works?  Google Analytics can provide you with advanced metrics and data about your website traffic, but many beginners consider its data collection and reporting very complex.

In this article, we’ll show you how Google Analytics collects data, processes it, and prepares reports in simplest terms possible. By the time we’re done, Google Analytics will no longer feel like a complicated mystery to you; we promise.

How Does Google Analytics Collect Data?

Google Analytics uses a small piece of Javascript tracking code to collect data about your website visitors and their interactions on your website. The tracking code looks something like below:


After you create your Google Analytics account, you need to add the script on your website. MonsterInsights helps you properly and easily add Google Analytics to your WordPress site and makes sure that it’s sending all interactions to Google Analytics.

Once it’s setup, Google Analytics will drop a cookie in the user’s browser for your website. It will help to track every interaction that user performs on your site.

So, what are the interactions?

Interactions are all the types of actions users perform on your website. They can be as simple as loading a page or something more specific like clicking a link or a video play button.

With each user interaction on your website, the tracking code sends information to Analytics about your users and their interactions on your website. The information sent by the tracking code is called a hit.

A hit is a URL string with parameters of useful information about your users which looks something like the code in the image below.


The URL string shown above passes some useful information to Analytics about the user that triggered the hit. The highlighted parts are what information we can see when we break down the string. It can include information like:

  • The language of the user’s browser
  • The name of the page they’re viewing
  • User’s device and its screen resolution
  • The Analytics ID

Moreover, Google Analytics widens the collected data using other sources like IP address, server-log files, and other ad-serving data. Using the widened additional data, it can understand things like a user’s location, age, gender, their browser, operating system, source/medium that referred them to the site, etc.

The information passed through the hits varies by different types of user interactions. There are 3 most common types of hits:

  • Pageview hit: This is the most common type of hit sent to Analytics. It’s triggered when a user loads a webpage with the tracking code on your site.
  • Event hit: An event hit is sent when a user interacts with a particular element on your website. It tracks actions like clicking a video play button, a particular URL, a product carousel, or submitting a contact form.
  • Transaction hit: Also called an eCommerce hit. A transaction hit passes data about the the user’s eCommerce purchases such as products purchased, transaction IDs, and stock keeping units (SKUs).

In addition, there’re other hits such as social hits that pass information about your social media likes, shares, or tweet data.