User ID: The Key to Cross-Device Analytics

A User ID stitches together a person's journey across devices and sessions, moving beyond anonymous tracking. It's key for apps with logins to see the full customer lifecycle. The footgun: never use the User ID for a custom dimension; it will break reporting.
The mental model
A User ID stitches together a single person's journey across multiple devices and sessions. Without it, a user browsing on their phone and later buying on their laptop appears as two separate people. With a User ID, analytics tools see one continuous customer journey, shifting the unit of analysis from anonymous sessions to actual people.
How it works
You, the developer, are responsible for generating and assigning a unique, persistent, non-personally identifiable ID to each user when they create an account. When a user signs in, you pass this ID to your analytics tool via a special, reserved user_id parameter. The analytics platform then associates all subsequent events with that ID until the user signs out. The logic is specific: send the ID for signed-in users, send a null value when they sign out to disassociate the session, and do not send the parameter at all for anonymous users.
When to use it
This is essential for any application with an authentication system. Three prime examples: first, e-commerce, to track a user who adds an item to a cart on mobile and completes the purchase on a desktop; second, SaaS products, to analyze feature adoption for a single user across web and native mobile apps; third, media services, to understand how a subscriber consumes content on their TV, tablet, and phone.
When not to use it
Avoid this for purely anonymous experiences where you have no stable identifier for a user. Do not try to create a user ID from transient data like a session cookie or IP address, as this defeats the purpose of persistent identity. More importantly, do not use this feature if you cannot guarantee the ID is unique and stable for each user over time.
One canonical example
The most common mistake is treating the User ID as a generic piece of data. A developer might want a report listing actions by each user, so they create a custom dimension in Google Analytics called 'UserID' and pass the ID to it. This is a critical error. Analytics systems are not designed for custom dimensions with millions of unique values (high cardinality). This will cause reports to become heavily sampled, group most data into an '(other)' row, and ultimately corrupt your analytics. The user_id must only be sent in its designated system parameter; the platform uses it for identity stitching behind the scenes, not for direct reporting dimensions.
Interview question
What is a critical error to avoid when implementing User ID in an analytics platform?
- a.Failing to send a null User ID when a user signs out of their account.
- b.Using personally identifiable information (PII) to generate the User ID.
- c.Creating a custom dimension to pass the User ID for direct reporting.Correct
- d.Generating the User ID from data that is not unique or stable over time.
Why? this is the answer
The card explicitly warns that creating a custom dimension for User ID is a "critical error" because its high cardinality will corrupt reports with sampling and "(other)" rows. The User ID is for identity stitching behind the scenes, not for direct reporting dimensions. While other options describe bad practices, the custom dimension issue is highlighted as the most common and critical error for report integrity.
Just read this? Test yourself on what you have been reading.
Read the original → developers.google.com
- #analytics
- #user tracking
- #metrics
- #google analytics
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on analytics — each one lists the topics its interview covers.
See open roles