Collecting user identity
Collecting user identity
At least once per session, the credentials of the logged-in user must be transmitted. To do this, there are two user data that can be used:
- logged in user's email
- your internal user identifier if it was communicated in the
refId
property of the contacts
Info
Internal user identifier corresponds to the refId
property (Contact ID field of the contact editing interface)
Info
All Javascript codes below must be executed after initialization of the Skalin script.
# Use of user email
The code below is used to collect a user identification event:
<script type="text/javascript">
ska(function(skalin){
skalin.identity({ email: {{UserEmail}} });
});
</script>;
2
3
4
5
UserEmail | Logged user's email already referenced in Skalin |
# Use of your user ID
The code below is used to collect a user identification event:
<script type="text/javascript">
ska(function(skalin){
skalin.identity({ id: {{UserId}} });
});
</script>;
2
3
4
5
UserId | Logged user's ID already referenced in Skalin |
# Multi-account users special-case
In the event that all or part of your users (non-internal) have access to several customer accounts, it is recommended to specify to the Skalin SDK the current customer for which the user is using your platform.
Info
This feature is optional if your users only have access to one unique client.
The code below is used to specify the current customer of the user:
<script type="text/javascript">
ska(function(skalin){
skalin.customerId({{CustomerId}});
});
</script>;
2
3
4
5
CustomerId | Internal identifier of the customer or his domain |
Info
Internal customer identifier corresponds to the refId
property (Customer ID field of the customer editing interface)
Warning
You must call the skalin.customerId(...);
method before any other SDK methods (identity, feature).