Analytics and Tracking

User ID

Also called user-ID, cross-device identifier

The stable identifier you assign to a logged-in customer and send to analytics, so their activity joins up across devices.

Quick facts: User ID

Category
Analytics and Tracking
Also called
user-ID, cross-device identifier
Level
Advanced
Affects
Cross-device reporting, customer value analysis, audience accuracy
Where to see it
GA4 reporting identity, the data layer, your CRM or login system
In this article4
  1. How User ID works
  2. Why User ID matters
  3. Where User ID goes wrong
  4. How to act on it

How User ID works

By default, analytics recognises a browser rather than a person. It writes an identifier into the device and treats every visit from that device as the same user, which means one customer using a phone, a laptop and an office computer arrives as separate users who never meet inside a report.

User ID replaces that guess with something you already know. When someone signs in, your site takes the internal reference your own database holds for that account and passes it to analytics with every hit, and the platform uses it to stitch those sessions together. Google Analytics 4 then offers a reporting view built on that identifier, falling back to the device-based one for visitors who never log in.

Why User ID matters

It changes what you are able to ask. Without it, a returning customer looks like new traffic every time they switch device, so repeat purchase behaviour, the true length of a sales cycle and any measure of customer value are all understated. With it, the record follows the account rather than the hardware.

It also corrects the raw counts. Device-based measurement inflates users and deflates engagement, because it splits one journey into fragments and treats each as a stranger. For a business with logged-in customers — a subscription, a client portal, an ecommerce account, a remittance app — the identifier is often the difference between analytics describing sessions and analytics describing customers. It rests on the same asset that makes first-party data valuable everywhere else: information you hold yourself.

Where User ID goes wrong

The dangerous mistake is sending something that identifies the person. Email addresses, phone numbers, full names and government identity numbers must not be used as the identifier. Google’s terms forbid personally identifiable information in Analytics, and once it is in the property the usual remedy is deleting the data. Send an opaque internal reference instead: a hashed value or a database key that means nothing outside your own systems.

The quieter failures are about consistency. If the identifier only fires on some pages, the sessions split anyway. If your website and your mobile app use different references for the same customer, the join never happens. If a customer’s reference changes when they update their account, their history breaks in half. And browsing done before sign-in cannot be retrofitted, because the platform can only join what it sees from the moment the identifier appears.

How to act on it

Start by deciding whether you have the raw material. If very few visitors ever log in, this is effort spent on a thin slice of traffic, and the analytics work is better aimed at event quality and conversion measurement. Where logins are central to the business, treat the identifier as part of the login flow rather than a marketing extra, and specify it with whoever builds the site.

Then test it properly. Confirm the value is present on every page after sign-in, that it survives navigation, that it matches between web and app, and that it never leaks into a URL or a page title where it would end up printed in reports. Document what the identifier maps to internally, and cover it in your privacy notice alongside the rest of your analytics and tracking disclosures.

Do and do not

Do

  • Send a pseudonymous reference, never an email address
  • Set the value on every page after sign-in
  • Use the same reference across web and app

Do not

  • Send names, emails or phone numbers as the identifier
  • Change a customer's reference between visits or systems
  • Expect it to join up browsing done before login

Questions people ask about this

Is a User ID personal data?

Treat it as personal data even though it should not contain a name. It is a stable reference to one individual, and combined with other information it can identify them, which is enough to bring it inside most privacy rules. Keep the value pseudonymous, explain it in your privacy notice, and be able to delete a person's data on request.

Can I use an email address as the User ID?

No. Google's terms prohibit sending personally identifiable information to Analytics, and an email address qualifies whether or not it appears in a report. If you need a value derived from the email, hash it inside your own systems first and send only the result, keeping the mapping between that hash and the customer entirely on your side.

Does User ID work for visitors who never log in?

Not for those visitors. They continue to be measured by device, and their earlier browsing is not attached retrospectively when they eventually sign in. In practice a property runs both views: the User-ID one for the logged-in population and the device-based one for everyone else, which is why the two report different user counts.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.