How Google Analytics Tracks Your Every Move After You Accept Cookie

How Google Analytics Tracks Your Every Move After You Accept Cookie

This article explains how ?? Google Analytics cookies track your every move across websites once you give consent. Discover the intricate client-server interactions, the role of unique Client IDs, and the detailed process of data collection and analysis. Learn what specific data are collected, including page views, document locations, referrers, document titles, and browser/system information, to provide insightful analytics.

Google Analytics data collection scheme

Google Analytics client-server  communication scheme
Google Analytics Architecture - Sequence Diagram

The sequence diagram illustrates the interactions between the user's browser, the website using Google Analytics, the Google Analytics script, and the Google Analytics server. It highlights the key role of the Google Analytics cookie in tracking user behavior across different websites.

Google Analytics data collection scheme explained

1. User Visits First Website:

  1. Action: The user navigates to www.example.com which uses the Google Analytics script.
  2. Execution: The Google Analytics script runs and checks if the Google Analytics cookie is present. If not, it sets a cookie with a ClientId and starts tracking all user actions.

2. User Visits Another Website:

  1. Action: The user navigates from www.example.com to another site that uses Google Analytics, such as www.anotherexample.com.

3. Web Page Loading:

  1. Action: As the user's browser loads www.anotherexample.com, it executes the Google Analytics script included in the webpage.

4. Script Execution:

  1. Action: The Google Analytics script runs and checks if the Google Analytics cookie is present.
  2. Details: This cookie would have been created during the user's previous visits to sites using Google Analytics.

5. Data Collection Initiation:

  1. Action: If the cookie is present, the script identifies the user/browser with the unique Client ID from the cookie.
  2. Details: The script begins collecting data about the user's interaction with www.anotherexample.com.

6. Data Collection and Cookie Access:

  1. Action: The Google Analytics script collects user interaction data.
  2. Details: The script accesses the Google Analytics cookie to retrieve the existing Client ID, ensuring continuity in tracking.

7. Sending Data to Google Analytics Server:

  1. Action: The collected data, along with the Client ID, is prepared to be sent to Google Analytics servers.
  2. Details: This communication typically occurs during or shortly after the webpage loads.

8. Data Processing by Google Analytics Server:

  1. Action: The Google Analytics servers receive and process the data.
  2. Details: The data is associated with the user's Client ID, allowing for an aggregated view of the user's behavior across different websites.


What data is sent from your web browser to the Google Analytics server?

When data is sent to Google Analytics servers, it includes information derived from the Google Analytics cookie and additional details collected by the GA script. This data is part of an HTTP request.

Key Data Points:

  • Client ID (from Cookie): A unique identifier, like: 123456789.987654321
  • Pageview Hit Type: For instance: pageview
  • Document Location URL: The current page URL, such as: https://www.example.com/about
  • Document Referrer: The referral page URL, like: https://www.google.com
  • Document Title: The title of the current page, e.g., About Us
  • Browser/System Information: Details like browser type, screen resolution, operating system, etc.

Example of HTTP Request to Google Analytics server

Here's a simplified representation of how this data might be structured in an HTTP GET request to the Google Analytics servers:

GET /collect?v=1&tid=UA-000000-2&cid=123456789.987654321&t=pageview&dl=http%3A%2F%2Fwww.example.com%2Fabout&dr=http%3A%2F%2Fwww.google.com&dt=About%20Us&...  
Host: www.google-analytics.com        

  • v=1 - Version of the measurement protocol.
  • tid=UA-000000-2 - The tracking ID / property ID.
  • cid=123456789.987654321 - Client ID from the GA cookie.
  • t=pageview - Type of hit, here a pageview.
  • dl=http%3A%2F%2Fwww.example.com%2Fabout - Document location URL, URL-encoded.
  • dr=http%3A%2F%2Fwww.google.com - Document referrer, URL-encoded.
  • dt=About Us - Document title.

This structured data is sent via a background HTTP request, typically initiated by JavaScript on the webpage, and is processed by Google Analytics to provide insights into user behavior and traffic across different websites.


Visit my website for more articles and insights.

Kateryna Hrankina

IT Healthcare Development Partner | Supporting Those Who Care for Others

9 个月

Thanks for sharing these insights, Andrii!

赞
回复
Julia Kurganova

Director of Growth @ Aimprosoft, IoT startups & IT Outsourcing, Dedicated Teams

9 个月

Thank you for the insights!

赞
回复
Antonina Yevtushenko

Healthcare software development team | 100% regulatory compliance | 20 healthcare projects in 3 years

9 个月

Thanks for the detailed description!

赞
回复
Iryna Begma

2 decades in Marketing & Sales | Follow me for my personal stories and best-kept lessons | Head of Sales at MLex

9 个月

The big brother is watching you ??

Maryna Kotenko

Making Magic ?? as a Business Development & Social Media Networker | Woman in Sales ?? | AI Enthusiast ??

9 个月

Honestly, this topic is still a mystery to me, so thanks for sharing!

要查看或添加评论,请登录

Andrii Minchekov的更多文章

社区洞察

其他会员也浏览了