Identify User
Using identify, you can associate events with specific users across sessions, devices, and platforms.
By default, Web SDK starts with an anonymous distinct id. When you call identify, anonymous activity is linked to your user id for future analysis.
Basic usage
import Paylisher from 'paylisher-sdk';
Paylisher.identify('user_id_from_your_database');
Identify with person properties
In Web SDK, person properties are attached through track as $set and $set_once payloads.
Paylisher.identify('user_12345');
Paylisher.track(
'user_logged_in',
{ login_method: 'email' },
{
name: 'Jane Doe',
email: '[email protected]',
plan: 'pro',
},
{
first_login_date: '2026-02-25',
}
);
How identify works
- Before login, events are tracked with an anonymous distinct id.
- After
identify('your_user_id'), future events use that identified id. - This helps merge product analytics across anonymous and authenticated flows.
Best practices
- Call
identifyimmediately after login. - If user is already authenticated on app load, call
identifyduring startup. - Use stable and unique ids from your backend (database id, UUID, or immutable user key).
- Avoid generic ids like
null,undefined,true, or fixed placeholders.