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 email & name.
Identify your users
To effectively manage your contacts, we advise using Gleap.IdentifyContactAsync() each time a user signs in or registers. This practice ensures accurate identification of your contacts from the outset. 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 using Gleap.UpdateContactAsync() for seamless real-time updates.
Identify your user by calling the following method (GleapUserProperty lives in GleapSDK.Models).
await Gleap.IdentifyContactAsync(
"12345",
new GleapUserProperty
{
Name = "Franz",
Email = "[email protected]",
Phone = "+1 (902) 123123",
CompanyName = "ACME inc.",
CompanyId = "19283",
Plan = "Pro plan",
Avatar = "https://.../avatar.png",
Value = 199.95,
CustomData = new Dictionary<string, object>
{
["key1"] = "Test",
["key2"] = "ACME",
},
});We currently only allow JSON strings, numbers and boolean values as custom data.
Enforce identity verification
Enforce identity verification to prevent third parties from impersonating logged-in users. Learn how to generate the user hash
await Gleap.IdentifyContactAsync(
"12345",
new GleapUserProperty
{
Name = "Franz",
Email = "[email protected]",
},
userHash: "GENERATED_USER_HASH");Update contact properties
The UpdateContactAsync method takes the same contact parameters as identify. Partial updates are possible.
await Gleap.UpdateContactAsync(
new GleapUserProperty
{
Plan = "Pro plan",
Value = 199.95,
});Clear the identity on logout
We recommend clearing the identity once the user logs out. Clearing the identity automatically detaches the current session and creates a new guest session.
await Gleap.ClearIdentityAsync();Get the identification status of a user
Gleap.IsUserIdentified();Get the current user identity
Gleap.GetIdentity();
