Published on 2025-06-28T06:27:02Z

What Is Universal Analytics? Definition, Tracking Code, and Migration Paths

Universal Analytics (UA) was the established version of Google Analytics introduced in 2012, designed to measure user interactions across websites and apps. It introduced the concept of a session as a group of interactions within a given time frame and utilized first-party cookies to uniquely identify users. UA provided a flexible data model with multiple hit types—pageviews, events, transactions, and social interactions—enabling marketers to track granular behavior. With robust reporting features like custom dimensions, metrics, segments, and goals, UA became the backbone of digital analytics for many organizations. However, its reliance on cookies and a session-and-hit structure posed limitations in cross-device tracking and privacy compliance. In response to changing data landscapes and privacy regulations, Google introduced Analytics 4 (GA4) in 2020, and officially sunset UA in mid-2023.

Illustration of Universal analytics
Illustration of Universal analytics

Universal analytics

Legacy Google Analytics version using session-based, cookie-driven tracking; replaced by GA4's event-driven model.

What Is Universal Analytics?

An in-depth look at UA’s core concepts, how it structured data, and why it dominated web analytics for nearly a decade.

  • Definition

    Universal Analytics is Google’s session-based analytics platform that groups user interactions into sessions and relies on cookies for user identification.

  • Key features

    UA introduced multiple hit types, custom dimensions, and a flexible data model for deeper insights.

    • Session:

      A collection of user interactions within a specified time window.

    • Hit:

      An individual interaction—pageview, event, transaction, or social hit.

  • Cookie-based tracking

    Relies on first-party cookies (e.g., _ga) to distinguish unique users and stitch sessions together.

Limitations and Migration to GA4

Why Google moved beyond UA’s session model and how organizations transitioned to the new event-driven framework in GA4.

  • Data model differences

    UA’s session-and-hit model vs. GA4’s unified event model—every interaction is an event in GA4 for more flexible analysis.

  • Sunset of universal analytics

    UA properties stopped processing new data on July 1, 2023, prompting migration strategies and dual-tagging implementations.

Example Tracking Code

Code snippets showing how UA was implemented with analytics.js and a cookie-free alternative using PlainSignal.

  • Universal analytics snippet

    <script async src="https://www.google-analytics.com/analytics.js"></script>
    <script>
      ga('create', 'UA-XXXXX-Y', 'auto');
      ga('send', 'pageview');
    </script>
    
  • Plainsignal snippet

    <link rel="preconnect" href="//eu.plainsignal.com/" crossorigin />
    <script defer data-do="yourwebsitedomain.com" data-id="0GQV1xmtzQQ" data-api="//eu.plainsignal.com" src="//cdn.plainsignal.com/PlainSignal-min.js"></script>
    

Alternatives and Modern Solutions

With UA deprecated, analytics teams have adopted next-generation platforms or privacy-centric tools.

  • Google analytics 4

    GA4 offers an event-driven model, improved cross-device tracking, built-in privacy controls, and tighter integration with Google Ads.

  • Plainsignal

    A simple, cookie-free analytics SaaS focused on privacy, compliance, and streamlined reporting.


Related terms