User Identification: Knowing Who Your Visitors Are

Home / Everything About / Everything About Analytics / User Identification: Knowing Who Your Visitors Are

Most visitors are anonymous. You know they visited. You know what they did. But you don't know who they are. A repeat visitor is counted as a new visitor each time they come back. You can't see their lifetime value. You can't see their journey across sessions. User identification solves this. When a visitor logs in, you capture their ID. You track them across sessions. You know who they are. You understand their behavior over time. This transforms your analytics from anonymous to personal.

This article explains how to set up user identification in analytics.

Understand Anonymous vs Identified Users**

Anonymous users are tracked by cookie or device ID. You know their behavior but not their identity. A visitor visits three times. Analytics counts them as three different visitors.

Identified users are tracked by a user ID. You know their identity. A visitor visits three times. Analytics counts them as one visitor with three sessions. You see their full journey.

Most visitors are anonymous. Some become identified when they log in. User identification bridges the gap.

Capture User IDs When They Log In**

When a visitor logs in, capture their user ID. Email. Username. Internal ID. Send this ID to your analytics platform.

Most analytics platforms have a User ID feature. In Google Analytics, set the User ID. In Segment, set the user_id. Every platform has a way to identify users.

Send the user ID immediately after login. Don't wait. Don't guess. Get it from your authentication system. Your system knows the true ID.

Link Anonymous Sessions to Identified Users**

A visitor browses anonymously. Then logs in. How do you connect these sessions. Most analytics platforms do this automatically. When you set a User ID, the platform retroactively links previous sessions.

Check your platform's documentation. Some require special configuration. Some do it automatically. Make sure it's working.

This retroactive linking is powerful. You can see the entire journey. What the visitor did before logging in. What they did after.

Set User Properties**

User ID is just a number. User properties add context. Customer type. Account plan. Signup date. Annual value. These properties describe the user.

Send user properties along with events. When a user makes a purchase, send their customer type. When they view pricing, send their current plan. Properties add context to events.

Properties let you segment analysis. Compare how premium users behave vs free users. Compare long-term users vs new users. Properties enable this segmentation.

Handle Logged-Out Users**

When a user logs out, stop using their User ID. Switch to anonymous tracking. This respects user privacy. You're not tracking them after they explicitly logged out.

In your analytics code, when logout happens, clear the User ID. Let the platform know the user is no longer identified.

Respect User Privacy**

User identification requires care. You're tracking individuals. Users expect privacy. Be transparent. Tell them you're tracking. Get consent if required.

Don't send personally identifiable information directly to your analytics platform. Send hashed or anonymized IDs instead. If you must send email, hash it first.

Have a data retention policy. How long do you keep user data. Delete old data. Respect user request to delete their data.

Analyze User Behavior Over Time**

With user identification, you can analyze long-term behavior. How does lifetime value change over time. What features do long-term users use. What do they avoid.

Compare cohorts of users. Users who purchased immediately vs users who took weeks. Users from different channels. User identification enables this analysis.

Frequently asked questions

Do we need user identification if most visitors don't log in?

Is user identification a privacy violation?

Can we use email as a user ID?

What if a user logs in from different devices?

How do we handle users who share a device?

Can we retroactively identify users?