Glossary Term

GA4 Client ID

glossary ga4 client id featured

The GA4 client ID is a randomly generated string that identifies a single browser on a single device to Google Analytics. GA4 stores it in a first-party cookie named _ga and attaches it to every event, which is how the platform groups hits into sessions and counts users. It identifies a browser, not a person.

Client ID Format

A GA4 client ID is two numbers joined by a dot:

1806452711.1713945600

The first number is a random integer generated when the cookie is created. The second is the Unix timestamp, in seconds, of the moment it was first set. That timestamp is why a client ID can double as a rough first-seen date.

The value you actually see in the browser carries a prefix. The full _ga cookie value looks like this:

GA1.1.1806452711.1713945600

GA1 is the cookie version and the digit after it reflects how many domain components the cookie is scoped to. The client ID is only the last two segments. Strip the GA1.1. prefix before sending the value anywhere.

GA4 also writes a second cookie per property, named _ga_ plus your measurement ID (for example _ga_ABC1234XYZ). That one holds session state, not the client ID. The _ga cookie defaults to a two-year expiry.

Client ID vs User ID

The client ID identifies a device. The User-ID identifies a person.

Client ID User-ID
Identifies One browser on one device One person across devices
Created by GA4, automatically You, from your own login system
Stored in The _ga first-party cookie Your database, sent with each event
Requires Nothing An authenticated user
Survives Until cookies are cleared or expire Indefinitely, as long as you assign it

Both can be active at once. When a visitor is logged out, GA4 falls back to the client ID. When they log in and you send a User-ID, GA4 can join that session to the same person’s activity on other devices.

Which identifier GA4 leans on depends on the reporting identity set in Admin. Device-based uses the client ID alone. Observed adds User-ID and Google signals. Blended layers modeled data on top of Observed.

Why the Client ID Matters

Every user count in GA4 rests on the client ID. Without a User-ID, GA4’s user total is really a count of distinct client IDs, which is why the number runs higher than your actual audience. One person using Chrome on a laptop, Safari on a phone, and a private window is three users.

The client ID also anchors attribution. GA4 ties the campaign source captured at the start of a session to the client ID, then credits later conversions from that same ID. If the ID resets, the original source is gone and the conversion lands in Direct.

Three practical jobs depend on having the value in hand:

  • Measurement Protocol. Server-side events sent to GA4 require a client_id field. Send the wrong one and the event creates a phantom user instead of joining an existing session.
  • CRM matching. Writing the client ID into a hidden form field lets you match a closed deal in your CRM back to the GA4 session and campaign that produced it.
  • BigQuery analysis. In the GA4 BigQuery export, the client ID appears as user_pseudo_id. That field is how you rebuild user-level journeys outside the interface.

How to Find Your GA4 Client ID

Three methods, from quickest to most precise:

  1. Read the cookie in DevTools. Open Application, then Cookies, then your domain. Find _ga and drop the GA1.1. prefix from its value.
  2. Ask gtag directly. Run this in the console on a page where GA4 is installed, replacing the measurement ID with your own:
gtag('get', 'G-ABC1234XYZ', 'client_id', function (clientId) {
  console.log(clientId);
});
  1. Send it as a custom dimension. GA4 does not report the client ID anywhere in the standard interface. To see it in reports, pass it as an event parameter and register a matching custom dimension, or query user_pseudo_id in BigQuery.

The gtag method is the reliable one for forms and tagging, because it returns the value GA4 will actually use rather than whatever is sitting in the cookie.

When the Client ID Breaks

A client ID is far less durable than its two-year cookie suggests.

  • Safari and ITP. Intelligent Tracking Prevention caps cookies written by client-side JavaScript at seven days. A Safari visitor returning after two weeks arrives as a brand-new user with a new client ID.
  • Cleared cookies and private windows. Both discard the cookie. The next visit starts a fresh ID with no history.
  • A second domain. The _ga cookie cannot be read across domains, so a journey spanning two sites splits into two client IDs unless you set up cross-domain tracking to pass the value.
  • Denied consent. Under Consent Mode with analytics_storage denied, no cookie is written, so no persistent client ID exists. GA4 models those sessions instead.

None of this is fixable at the cookie level. The practical defence is to make sure every inbound link carries campaign parameters, so a session’s source survives even when its client ID does not. Checking tagged links against GA4 with the GA4 URL tester confirms the campaign data lands before a campaign goes out.

Frequently Asked Questions

What is the client ID in Google Analytics?

The client ID is the identifier GA4 assigns to a browser the first time it loads a tagged page. It lives in the _ga first-party cookie and travels with every event that browser sends. GA4 uses it to group events into sessions and to count users when no User-ID is available.

What does the _ga cookie value mean?

A _ga value such as GA1.1.1806452711.1713945600 has two parts. GA1.1. is a version prefix plus the domain scope, and the two numbers after it are the client ID itself: a random integer and the Unix timestamp of when the cookie was created.

What is the difference between client ID and User-ID?

The client ID identifies one browser and is generated by GA4 automatically. The User-ID identifies one person, comes from your own login system, and must be sent deliberately. A single person can hold many client IDs but only one User-ID, which is what makes cross-device reporting possible.

Is the GA4 client ID personal data?

Treat it as personal data. It is a persistent online identifier tied to a device, and European regulators have consistently taken that view in Google Analytics rulings. Google’s own policies separately prohibit sending directly identifying information such as an email address to Analytics.

Is the client ID the same as the measurement ID?

No. The measurement ID (G-ABC1234XYZ) identifies your GA4 data stream and is the same for every visitor. The client ID identifies an individual browser and is different for each one.

To confirm your campaign links reach GA4 with the right source before a send goes out, run them through the GA4 URL tester at linkutm.