What is the GA4 client ID?
The GA4 client ID is a random identifier stored in the `_ga` first-party cookie. It travels on every hit as the `cid` parameter and ties requests from the same browser together, which is how GA4 counts one user across several sessions.
Why it matters
Google Analytics needs a way to count people. It can't use names or emails (that's not anonymous, and it's regulated). Instead it uses a random ID. That ID sits in a cookie on your browser. Every time you visit, your browser reads the cookie and sends the same ID back. Google Analytics sees the same ID and thinks "this is the same person I saw before."
That ID is the client ID. It's the foundation of user counting in GA4. Without it, every page view would look like a brand-new visitor.
The client ID is pseudonymous. It doesn't identify you by name or email. It's just a random number, a stand-in for "user 12345.67890". Multiple devices have different IDs. Clearing cookies wipes the ID. It's not personal, but it is persistent per browser.
How it works
When your browser first visits a site with GA4, the gtag.js snippet generates a random client ID and stores it in a first-party cookie called _ga. The cookie format looks like this:
_ga=GA1.1.12345678901.1234567890
The parts are:
GA1.1: version marker (GA1 means Google Analytics 1, the "1.1" is internal)12345678901: the random client ID (usually a 10-digit number)1234567890: the timestamp when the cookie was created (Unix epoch)
That client ID stays in the cookie for two years by default. Every hit your browser sends includes it as the cid parameter. Google Analytics uses the same cid to group hits into one user.
When you switch browsers or clear cookies, the cookie is gone. Next time you visit, the browser gets a new random cid. Google Analytics sees it as a new visitor because it's genuinely a different device or a fresh browser state.
What does not matter
The client ID is not your user ID. If you have a logged-in user system, the client ID doesn't connect to it automatically. GA4 has a separate user_id parameter for when you want to use your own user accounts. Plenty of sites use the client ID alone and never set user_id. That's fine.
Also, client IDs don't sync across devices. Your phone has one client ID, your laptop has another. GA4 won't know they're the same person unless you explicitly set a user_id that ties them together. The cid alone is device-scoped, not person-scoped.
And the ID itself doesn't tell you anything. It's random noise. You can't reverse it to identify someone. If Google Analytics data leaks, the client IDs are useless without the full hit payload and cookie dates.
Code example
When gtag.js initialises, it sets the _ga cookie:
// In your page
gtag('config', 'G-XXXXXXXXXX');
// Behind the scenes, gtag.js creates _ga if it doesn't exist
// _ga = GA1.1.123456789012.1700000000
Then, on every hit sent to Google, the cid parameter carries that value:
GET /g/collect?v=2&tid=G-XXXXXXXXXX&cid=123456789012.1700000000&en=page_view
If you send a hit manually, you can read the cookie and pass it explicitly:
// Get the client ID from the _ga cookie
const cookies = document.cookie.split('; ');
const gaCookie = cookies.find(c => c.startsWith('_ga='));
const clientId = gaCookie.split('.').slice(2).join('.');
// Send it in your own request
fetch('https://www.google-analytics.com/g/collect', {
method: 'POST',
body: `v=2&tid=G-XXXXXXXXXX&cid=${clientId}&en=page_view`
});
How Scalpel Tags shows it
Scalpel Tags displays the client ID in the decoded hit parameters. In the hit table, look for the Session group. The cid parameter is listed there with its full value. Scalpel Tags also shows the cookie itself in your browser's DevTools if you inspect Storage > Cookies and search for _ga.
If a hit is missing a cid, Scalpel Tags marks it as empty or unknown. That usually means the page loaded without gtag.js, or the cookie was cleared before the request fired.