UUID as a Helper in Data Analytics

Topics: ,

A UUID is as unique as, for example, a fingerprint. It is a 128-bit string designed to identify across all platforms, applications, devices and universes. By assigning a UUID parameter you can identify user behaviour very quickly and easily.

In modern web and data analytics a fundamental question arises, namely tracking user behaviour on the basis of a unique ID. You may know the concept of a unique ID mainly from web analytics under the name "user_id". It is a concept where your website or app can issue an unambiguous user identifier to analytics and advertising systems. This topic touches not only the much-discussed user privacy and the "user_id" parameter itself, but also the generation of an "anonymous id" or a "cookie id". Implementing a unique ID for your users and customers is up to you as the operator. It is probably clear that rather than generating three different IDs, the so-called UUID, or Universal unique identifier, comes in as a helper.

What Actually Is a UUID?

A UUID is a universal identifier that can be used as a placeholder parameter for the situations mentioned above. It is a string assigned to a specific data element, above all for the purpose of identification.

The main difference between a universal identifier and an ordinary identifier is that a UUID is universally unique. It is therefore unlikely that we will run into two identical values within a universal identifier. This uniqueness then makes it easier to identify specific data elements across platforms, applications, systems and databases without losing consistency in data analysis.

UUID vs Cookie

The alternative to a universal identifier is to use third-party cookies to collect data from browsers. A cookie is a piece of a data string that is stored in the user's web browser. If the cookie data is stored directly in the internal storage of the user's device, the user can then be tracked and measured across websites for the whole time they browse.

The main problem with cookies, however, is the protection of user privacy. Many users who are aware of these risks find it rather unpleasant to share their data with a third party. This creates an additional problem: how that user data is used after it has been provided. For this reason, too, more and more web browsers are blocking third-party cookies in order to protect user data.

This is where the UUID method comes in, that is, an identifier that contains no personally identifiable information (PII – Personal identifiable information). All browsing data is anonymous, which protects user privacy. A universal identifier is generated on the basis of the device number and a time value. That is why they are so unique, and we cannot identify the identity of the user on the basis of a universal identifier alone.

The Technical Side of UUID

UUID stands for universally unique identifier, which is a 128-bit number, created so that it is unique for every instance. A universally unique identifier consists of 32 hexadecimal digits. They are divided into five groups separated by hyphens. For example: 123e4567-e89b-12d3-a456-426614174000.

A document called RFC 4122 contains the rules for creating and using UUIDs. There are several versions and variants of UUID, which use different generation methods, such as a random number, time and a MAC address. The aim of a UUID is to ensure the universal uniqueness of identifiers without the need for a central authority.

UUID Versions

A universal identifier has several versions. Below we present the 5 versions that exist:

Version 1 – Time-based – This version combines the current time, a clock sequence and a value specific to the device, most often the MAC address.

Version 2 – DCE Security – This is a kind of upgrade of Version 1 using the Distributed Computing Environment (DCE).

Version 3 – MD5 – This version uses MD5 hashing of a "namespace" and a "name". Generating a universal identifier with the same parameters then produces an identical output. The MD5 method therefore gives reproducible results.

Version 4 – Random – As the name suggests, this is a completely randomly generated host number. This method is widely used today because it is simple and at the same time the probability of two identical values is practically zero.

Version 5 – SHA-1 – Similar to Version 3, the only difference being that the SHA-1 algorithm is used instead of MD5.

To generate a universal identifier you can use this tool: Online UUID Generator Tool

Version 1 – example:

847da290-165b-11ee-be56-0242ac120002
847da52e-165b-11ee-be56-0242ac120002
847da8c6-165b-11ee-be56-0242ac120002
847daa10-165b-11ee-be56-0242ac120002
847dab46-165b-11ee-be56-0242ac120002
847dac72-165b-11ee-be56-0242ac120002
847dad8a-165b-11ee-be56-0242ac120002
847daea2-165b-11ee-be56-0242ac120002
847dafba-165b-11ee-be56-0242ac120002
847db33e-165b-11ee-be56-0242ac120002

Version 4 – example:

880eb804-a10e-40b9-ad47-f672317983ab
c094796e-1954-48c4-bfaa-f07e62b52302
76f6bb72-5f16-415d-af7f-7d9e4ff63bf5
bbeec6fe-4bc1-43a9-b3b9-3c8fc3f7dd77
eb5738e6-460e-42cd-8c50-8c9b6b358a1e
63bd4d45-8f79-4229-9d36-fff4e442db3c
eb84409c-2d20-472b-af58-69e1638d5035
0922baa6-3991-409a-8336-3dbc2fc1abd6
e5953fd1-f13d-4a8d-a8fe-c09da8875cdf
28b98e86-10a2-4521-b456-00a5ba6ee0f8

Implementation Example

The following example shows the implementation of a version 4 universal identifier, that is, a completely randomly generated number based on the host.

Basic function

crypto.randomUUID()

Implementation

<html>
 <head>
 </head>
 <body>
   <script>
      console.log("Random UUID -> " +crypto.randomUUID());
      console.log("Random UUID -> " +crypto.randomUUID());
      console.log("Random UUID -> " +crypto.randomUUID());
      console.log("Random UUID -> " +crypto.randomUUID());
   </script>
 </body>
</html>

Sources: