Google Analytics Client ID in GA4: what it is and how to get it

The Client ID is the identifier Google Analytics 4 stores in the _ga cookie to tell one browser from another. GA4 counts users by it, sends it with every event, and writes it to the BigQuery export as user_pseudo_id. It identifies a browser on a device, not a person.
That last point explains most of the questions about it. Someone who visits from Chrome on a laptop, from a phone, and from Firefox on the same laptop is three Client IDs, and three users in a GA4 report. This guide covers what the Client ID is, how it works, four places to find it, how to read it in code, and how to use it to connect GA4 data with a CRM.
What is the Client ID in Google Analytics 4
What is the Client ID in Google Analytics 4
The Client ID (also written client_id, cid or clientId) is a pseudonymous identifier that the GA4 tag generates on a visitor’s first page view and stores in a first-party cookie. Google’s description of the cookie is one line: _ga is “used to distinguish users” (Google Analytics Help, checked October 2026).
What it is not:
- Not a measurement ID. The measurement ID (
G-XXXXXXXXXX) identifies your data stream. The Client ID identifies a visitor’s browser. - Not a User ID. A User ID is an identifier you assign to a signed-in person. The difference is covered below.
- Not a Google account. It says nothing about who the visitor is.
How the Client ID works
On the first visit the Google tag creates the _ga cookie. The value looks like this:
GA1.1.904941809.1556093647
GA1is the cookie format version.- The next number is the domain level the cookie is set on.
- Everything after the second period is the Client ID: a random number, a period, and the time the ID was created as a Unix timestamp.
The tag sends this ID with every event. GA4 groups events with the same ID into one user.
The cookie expires after 2 years by default, and the expiry is counted from the most recent visit unless you change it. You can set it from zero to 25 months under Admin, Data streams, your stream, Configure tag settings, Override cookie settings. Browsers can shorten it regardless: Google’s page gives a maximum of 400 days in Chrome and 7 days in Safari for a visitor who does not return.
A new Client ID is created whenever the cookie is gone: after the visitor clears cookies, in a private window, in another browser, on another device, or when the cookie expires. Each time, GA4 sees a new user.
OWOX Data Marts
See your first report built in real time. 15 minutes.
- Connect your data warehouse
- Pick your metrics
- Get a live Google Sheets report
In the time it takes to write a ticket. Then imagine never writing that ticket again.
Book a DemoWe'll use your actual use case
How to find the Client ID in GA4
How to find the Client ID in GA4
1. In the User explorer
Open Explore and choose the User explorer technique. Each row is one Client ID (the column is called App-instance ID), with its event count, sessions and revenue.

Click an ID to see that visitor’s events in order.

This is the only standard report that shows the Client ID, and you cannot add other dimensions to it.
2. In the BigQuery export
Every event in the GA4 BigQuery export has a user_pseudo_id field. For a web stream it holds the Client ID. If the property is linked to BigQuery, this is the easiest place to work with the ID, because it is already on every row. Linking is described in connecting GA4 to BigQuery.
3. In the browser’s cookies
To see your own Client ID in Chrome, open the site, press F12, go to the Application tab, open Cookies and select the site. Find the cookie named _ga. In Firefox, the cookies are on the Storage tab of the developer tools.

4. In code, with gtag.js
The Google tag has a documented command for this. It returns the ID through a callback once the tag has loaded:
gtag('get', 'G-XXXXXXXXXX', 'client_id',
(clientId) => {
console.log(clientId);
}
);
Replace G-XXXXXXXXXX with your measurement ID. The same command returns session_id and session_number (gtag.js reference, checked October 2026). Use this instead of parsing the cookie yourself where you can: it keeps working if the cookie format changes.
How to send the Client ID to GA4 as a custom dimension
How to send the Client ID to GA4 as a custom dimension
Read this before you do it. Google advises against registering a per-user identifier as a custom dimension: “Don’t use a custom dimension to create a distinct identifier for each user” (About the (other) row). A dimension with one value per visitor is high-cardinality, and it pushes reports toward the (other) row.
If you only need the Client ID next to other data, you do not need a custom dimension at all. It is already in the BigQuery export. Register it only if you must see it in GA4 explorations.
If you do:
Step 1. Create the custom dimension. In Admin, open Custom definitions, click Create custom dimension, name it client_id, set the scope to User and the user property to client_id.

Step 2. Read the value in Google Tag Manager. Create a Custom JavaScript variable that reads the ID from the cookie:
function() {
var m = document.cookie.match(
/(?:^|;\s*)_ga=GA\d\.\d\.(\d+\.\d+)/
);
return m ? m[1] + '.' : undefined;
}

Step 3. Send it as a user property named client_id from your Google tag, then check it in GTM preview mode and in GA4 DebugView.
Why the function appends a period. The Client ID looks like a number, and GA4 treats it as one. In DebugView the value arrives as 1.58001e+09 and the explorations show it truncated. A trailing non-numeric character keeps it a string.

The tag setup itself is covered in GA4 tags in Google Tag Manager.
Client ID vs User ID
| Client ID | User ID | |
|---|---|---|
| Who creates it | The Google tag, automatically | You, when a person signs in |
| What it identifies | A browser on a device | A person, across devices |
| Where it lives | The _ga cookie |
Your own system; sent with events |
| When it changes | Cookie cleared or expired, new browser or device | When you decide |
| Field in the BigQuery export | user_pseudo_id |
user_id |
Use both when you can. The Client ID covers every visitor, signed in or not. The User ID joins the browsers of the people who do sign in. Never put an email address or other personal data into either.
Why pass the Client ID to your CRM
Why pass the Client ID to your CRM
GA4 knows what a browser did on the site. Your CRM knows what happened afterwards: whether the lead was qualified, whether the deal closed, for how much. The Client ID is the key that lets you put those two facts in one row.
The mechanics are simple:
- Read the Client ID with
gtag('get', ...)when a form loads. - Write it into a hidden form field.
- Store it on the lead or order record in the CRM.
From then on every CRM record carries the ID of the browser that created it. More on the integration, including sending CRM events back to GA4, is in how to connect a CRM with Google Analytics 4.
Where GA4 stops, and what to do in BigQuery
Where GA4 stops, and what to do in BigQuery
Inside GA4 the Client ID is close to unusable for this. It appears in one report, it cannot be combined with other dimensions without a custom dimension Google advises against, and there is no place to bring CRM deals in next to it.
In the warehouse it is a join key. This query runs as written on Google’s public GA4 sample and builds one row per Client ID, the shape you join to a CRM table:
SELECT
user_pseudo_id AS client_id,
MIN(DATE(TIMESTAMP_MICROS(event_timestamp)))
AS first_seen,
ANY_VALUE(traffic_source.source) AS first_source,
ANY_VALUE(traffic_source.medium) AS first_medium,
COUNT(DISTINCT (
SELECT value.int_value
FROM UNNEST(event_params)
WHERE key = 'ga_session_id')) AS sessions,
COUNTIF(event_name = 'purchase') AS purchases
FROM
`bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20210101' AND '20210131'
GROUP BY client_id
traffic_source holds the source that first acquired the user, so it is the same on all of a user’s events. With the CRM table in the same warehouse, JOIN crm_leads ON crm_leads.ga_client_id = client_id gives you the first source and the session count of every lead, next to its deal status.
Two honest limits. The join only covers leads whose form captured the ID, so expect gaps for phone calls and imports. And one person with two browsers is still two Client IDs; a User ID or the CRM’s own contact ID is what merges them.
Keep the join where everyone can use it
Keep the join where everyone can use it
The first version of this join is usually a query in one analyst’s console. The marketer who wants “leads by first source” asks for it every month, and every answer is a new run of a slightly different query.
OWOX Data Marts is built for the step after the query works. The analyst saves the SQL as a Data Mart on the warehouse, describes what client_id and first_source mean in it, and publishes it. Reports on that Data Mart go to Google Sheets or Data Studio (the former Looker Studio) on a schedule, so the marketer reads the same joined table every time.
OWOX Data Marts does not collect Client IDs and is not a GA4 connector. It works on tables that are already in your warehouse: the GA4 export and whatever your CRM writes there. The join logic stays the analyst’s SQL. The step from raw export tables to reporting tables is described in GA4 export to BigQuery and data modeling.
Turn your data into decisions.
Governed data marts give you the clean foundation ML needs to actually work.
- No AI hallucinations
- Analyst-governed definitions
- Every number traces to SQL
Frequently Asked Questions
What is the Client ID in Google Analytics 4?
The Client ID is the identifier GA4 stores in the _ga cookie to tell one browser from another. It identifies a browser on a device, not a person, and appears in the BigQuery export as user_pseudo_id.
How do I get the GA4 Client ID with gtag.js?
Use the documented command gtag('get', 'G-XXXXXXXXXX', 'client_id', callback) with your measurement ID. The callback receives the Client ID once the tag has loaded.
What is the difference between Client ID and User ID?
The Client ID is created automatically for every browser and changes with a new browser, device or cleared cookies. The User ID is an identifier you assign to a signed-in person and send to GA4, so it can join one person's devices.
Should I send the Client ID to GA4 as a custom dimension?
Google advises against registering a per-user identifier as a custom dimension, because it creates a high-cardinality dimension. If you need the Client ID next to other data, use user_pseudo_id in the BigQuery export instead.



