The Gleap Identify call lets you tie a user to their feedback items. It includes a unique User ID and optional meta information such as their email and name.
Identify your users
To effectively manage your contacts, we advise using Gleap.identify() each time a user signs in or registers. This practice ensures accurate identification of your contacts from the outset. Additionally, for scenarios where contact information needs to be updated during active usage – such as when a user subscribes to a new plan or modifies their existing data – we recommend utilizing Gleap.updateContact(). This method allows for seamless real-time updates to contact details.
Identify your user by calling the following method.
Gleap.identify("19283", {
name: "Franz",
email: "[email protected]",
phone: "+1 (902) 123123",
value: 199.95,
plan: "Pro plan",
// Optional: associate the user with a company.
company: {
id: "acme-inc",
name: "ACME inc.",
},
// Passing the createdAt property allows you to set the correct createdAt date. (optional)
createdAt: new Date(),
customData: {
key1: "awesome",
key2: true,
},
});The optional company object associates the user with a company. Only company.id is required — it is your own identifier for the company. The optional company.name is a fallback label and never overwrites a name set authoritatively via the server-side Companies API.
company object requires SDK version 16.3.0 or later. On earlier versions, pass the flat companyId and companyName properties instead — they remain fully supported.We currently only allow JSON strings, numbers and boolean values as custom data.
Enforce identity verification
To require authentication for new conversation attachments, see Authenticated conversation files, including the customer login URL and redirect setup.
Enforce identity verification to prevent third parties from impersonating logged-in users. Learn how to generate the user hash
Gleap.identify(
"19283",
{
name: "Franz",
email: "[email protected]",
phone: "+1 (902) 123123",
value: 199.95,
plan: "Pro plan",
company: {
id: "acme-inc",
name: "ACME inc.",
},
customData: {
key1: "awesome",
key2: true,
},
},
"GENERATED_USER_HASH"
);Click here to learn how to generate the user hash.
Update contact properties
To effectively manage your contacts, we advise using Gleap.identify() each time a user signs in or registers. This practice ensures accurate identification of your contacts from the outset. Additionally, for scenarios where contact information needs to be updated during active usage – such as when a user subscribes to a new plan or modifies their existing data – we recommend utilizing Gleap.updateContact(). This method allows for seamless real-time updates to contact details.
Gleap.updateContact({
value: 199.95,
plan: "Pro plan",
});The updateContact method takes in the same contact parameters as the identify method. Partial updates are possible.
Gleap.updateContact({
name: "Franz",
email: "[email protected]",
phone: "+1 (902) 123123",
value: 199.95,
plan: "Pro plan",
company: {
id: "acme-inc",
name: "ACME inc.",
},
customData: {
key1: "awesome",
key2: true,
},
});Removing data
Update are run incrementally. If you want to remove data, you can do so by adding a key value pair with null as value.
Gleap.updateContact({
keyToDelete: null,
});Clear the identity on logout
We recommend to clear the identity once the user logs out. Clearing the identity will automatically detach the current session and create a new guest session.
Gleap.clearIdentity();Get the identification status of a user
With the following method, you can get the status of the current user identity.
Gleap.isUserIdentified();Get the current user identity
With the following method, you can get the current user identity.
Gleap.getIdentity();
