Users
In order to track your authenticated users through their navigation, you can set their identifiers once and our SDKs will automatically send the dedicated properties in each events.
Our SDKs will store these identifiers client-side by default. You can however disable this feature when calling the method.
Set user identifiers
- Javascript
Method:
pa.setUser(userId[, userCategory, storeId])
Parameters | Type | Description |
---|---|---|
userId | string | User identifier |
userCategory | string | User category |
storeId | boolean | Indicates whether the identifiers should be stored (true - default) or not (false ) |
pa.setUser('WEB-192203AJ', 'premium', false);
Retrieve user data
You can retrieve user data thanks to a dedicated method
- Javascript
Method:
pa.getUser(callback)
Parameters | Type | Description |
---|---|---|
callback | function | Callback of the method |
pa.getUser(function(userData) {
console.log('User: ' + userData.id + ', Category: ' + userData.category)
});
Delete user data
You can delete user data thanks to a dedicated method
- Javascript
Method: pa.deleteUser()
pa.deleteUser();