Table of Contents

About

ClientId is the anonymous user id in Google analytics

Management

Creation

If a cookie does not exist for the specified domain, a client ID is generated and stored in the cookie

Get

Web

The client id is stored in the utma cookie

You can get it programmatically

ga(function(tracker) {
  console.log(tracker.get('clientId'));
});
1161459517.1575879169

where:

  • 1161459517, the first number is a random number.
  • 1575879169, the second number is the epoch timestamp (in second) of the initial visit (It is set as soon as you enter the site).

Example:

clientId = '1161459517.1575879169'
clientIdParts = clientId.split('.');
console.log('The random number is : '+clientIdParts[1]);
console.log('The initial Visit was at: '+(new Date(1000*clientIdParts[1])));

Mobile

For mobile apps, this is randomly generated for each particular instance of an application install. The value of this field should be a random UUID (version 4)

Example value: 35009a79-1a05-49d7-b876-2b884d0f825b

Documentation / Reference