Skip to main content

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.

important

The first string assigned to the user_id will be applied to all events within the visit. We recommend leaving it unset if the user is not logged in.

Set user identifiers

Method:

pa.setUser(userId[, userCategory, enableStorage])

ParametersTypeDescription
userIdstringUser identifier
userCategorystringUser category
enableStoragebooleanIndicates 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

Method:

pa.getUser(callback)

ParametersTypeDescription
callbackfunctionCallback 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

Method: pa.deleteUser()

pa.deleteUser();