User Identification
Link sessions to your users to easily find and debug their issues.
Why identify users?
- Search by user – Find all sessions for a specific user when they report an issue
- Support integration – Link sessions to your helpdesk tickets
- User journey – See all sessions from the same user over time
Basic Identification
Call identifyUser() after your user logs in:
import PipeKit// After successful loginfunc onLoginSuccess(user: User) {PipeKit.identifyUser(userId: user.id,email: user.email,name: user.displayName)}// Or with just a user ID
Additional User Data
Add more context about your users with custom properties. Pass extra fields via additionalInfo on identifyUser(), or set arbitrary properties with setUserInfo():
// Pass extra fields when you identifyPipeKit.identifyUser(userId: user.id,email: user.email,name: user.displayName,additionalInfo: ["plan": user.subscriptionPlan,"company": user.companyName,])// Or set arbitrary user propertiesPipeKit.setUserInfo(["userId": user.id,"email": user.email,"name": user.displayName,"plan": user.subscriptionPlan,"company": user.companyName,"signupDate": user.createdAt.description])
Searchable properties
The userId and email fields are searchable in the dashboard. Other properties are displayed in session details.
Reset User on Logout
When a user logs out, end the current session and reset their identification to avoid mixing sessions across users:
func onLogout() {// Stop (and upload) the current sessionPipeKit.stopSession()// Reset identification for the next userPipeKit.setUserInfo([:])}
Anonymous Users
For users who haven't logged in, you can still track them with a device ID:
// Use device identifier for anonymous usersimport UIKitimport PipeKitlet deviceId = UIDevice.current.identifierForVendor?.uuidString ?? "unknown"PipeKit.identifyUser(userId: "anon_\(deviceId)")// Or generate your own anonymous IDlet anonymousId = UserDefaults.standard.string(forKey: "anonymousUserId")?? UUID().uuidStringUserDefaults.standard.set(anonymousId, forKey: "anonymousUserId")PipeKit.identifyUser(userId: anonymousId)
Best Practices
✓ Use stable identifiers
Use your internal user ID or email. Avoid identifiers that change (like session tokens).
✓ Identify early
Call identifyUser() as soon as you know who the user is, ideally before or right after startSession().
✓ Don't include PII in user properties
Avoid storing sensitive data like passwords, SSNs, or credit card numbers in user properties.
Next: Privacy & Masking
Learn how to protect sensitive data and user privacy in recordings.
Continue to Privacy →