Published on 2025-06-27T23:50:45Z

What is a UUID? Examples for Analytics Tracking

A UUID (Universally Unique Identifier) is a 128-bit value formatted as a string of hexadecimal digits, designed to uniquely identify objects in computer systems. In the analytics industry, UUIDs serve as resilient, privacy-friendly user identifiers that persist across sessions and devices without relying on cookies. They reduce duplication in visitor counts and improve data consistency by providing an enormous address space that virtually eliminates the risk of collision. Different UUID versions offer generation methods suited to specific needs—random (v4) for privacy, time-based (v1) for ordering, or hash-based (v3/v5) for deterministic mapping. Tools like Google Analytics 4 and Plainsignal both leverage UUIDs—GA4 through its built-in client_id cookie and Plainsignal via localStorage—to track users while complying with modern privacy regulations. Because of their design, UUIDs are virtually impossible to predict or reproduce, strengthening user privacy and security.

Illustration of Uuid
Illustration of Uuid

Uuid

A 128-bit identifier used in analytics to uniquely track users across sessions and devices without relying on cookies.

Understanding UUID Structure

UUIDs follow a standardized 128-bit format, typically displayed as five groups of hexadecimal digits separated by hyphens. Different versions define how the bits are generated or derived.

  • Version 1 (time-based uuid)

    Timestamp and MAC address produce a unique ID, providing ordering but embedding node information.

    • Timestamp:

      60-bit value representing 100-nanosecond intervals since October 15, 1582.

    • Clock sequence:

      14-bit number that prevents duplicates in case of clock regression.

    • Node:

      48-bit number usually derived from the device’s MAC address.

  • Version 4 (random uuid)

    Random or pseudo-random numbers seed the UUID, offering a privacy-friendly generation method.

    • Random bits:

      122 bits generated randomly or via a cryptographic PRNG.

    • Variant and version bits:

      6 bits reserved to indicate the UUID version and variant.

Why UUID Matters in Analytics

Using UUIDs helps analytics teams uniquely identify visitors across sessions, devices, and storage mechanisms. They reduce duplication, improve data accuracy, and enhance privacy compliance compared to traditional cookies.

  • Persistent user identification

    UUIDs persist beyond individual sessions and can be stored client-side or server-side to recognize repeat visitors.

  • Cross-device tracking

    Link user interactions across multiple devices when the same UUID is applied across touchpoints.

  • Privacy and compliance

    UUIDs generated without personal data help comply with GDPR and CCPA by avoiding PII.

Implementing UUID in Plainsignal (Cookie-Free Analytics)

PlainSignal uses a cookie-free approach by generating and storing a UUID in localStorage. Below is the typical tracking snippet.

  • Tracking script setup

    Include the following in your HTML to initialize PlainSignal with UUID generation:

    <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>
    
  • Uuid handling

    PlainSignal generates a UUID on first page load and stores it in localStorage for subsequent requests, ensuring stable user identification without cookies.

Using UUIDs in Google Analytics 4

GA4 uses a UUID-formatted client_id generated via gtag.js or analytics.js, which you can customize or override with your own identifier.

  • Default client_id generation

    GA4 automatically generates a UUID and stores it in the _ga cookie under the client_id field.

  • Custom uuid setup

    Override the default client_id by passing your own UUID in the gtag config:

    gtag('config', 'G-XXXXXXXX', {
      'client_id': 'YOUR_UUID_HERE'
    });
    

Related terms