User Identification (Flutter)
Tie events to specific users in your mobile app.
1. Identify
Call identify() when a user logs into your Flutter application. This persists their unique ID in SQLite, so even if they close and reopen the app, they remain identified.
dart
1EmpAnalytics.identify("user_12345");| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | String | Yes | The unique ID for this user in your backend. |
2. Alias (Sign Up)
Call alias() at the exact moment a user registers a new account to link their anonymous device history to their new account.
dart
1// 1. Alias to the new ID2EmpAnalytics.alias("new_user_890");3 4// 2. Identify as the new ID5EmpAnalytics.identify("new_user_890");3. Reset (Logout)
When a user logs out, clear their session and generate a new anonymous ID.
dart
1EmpAnalytics.reset();User Profiles (People API)
Update properties directly on the user's profile in the database without firing a track event.
dart
1// Set multiple properties2EmpAnalytics.people?.set({3 "Full Name": "John Doe",4 "Email": "john@example.com",5});6 7// Increment numeric properties8EmpAnalytics.people?.increment("Login Count", 1);9 10// Append to an array (e.g., interests or tags)11EmpAnalytics.people?.append("Interests", "Flutter");