Identify users in the help center

Steps on how to identify your users in the help center

The current problem is that we don’t know which Gleap user is accessing the help center and therefore the widget does not reflect their existing sessions and audience rules are not working if you set them up in the help center.

Setup a redirect URL

We got you for that problem!
In the help center settings you can set up a “Login redirect URL” in the “Gleap identify” sections.

What Gleap will do now is every time a user accesses your help center and the are not already identified the user will get redirected to your provided URL.

Handle the identify on your side

Now you have the identify in your hands.

If you redirect to your website where the user is already identified you can just call Gleap.getIdentity() like this:

// Check if user is already identified in Gleap
const userData = Gleap.getIdentity();

// If a userId exists the user is not a Guest
if (userData?.userId) {
  const gleapId = userData.gleapId;
  const gleapHash = userData.gleapHash;

  // Redirect back from url param redirect
  const urlParams = new URLSearchParams(window.location.search);
  const redirectUrl = urlParams.get('redirect');
  if (redirectUrl) {
    window.location.href = `${redirectUrl}?gleapId=${gleapId}&gleapHash=${gleapHash}`;
  }
} else {
  // Show login form
}

If the user is not already identified in Gleap, display a login form.

After login, call Gleap.identify() and execute the logic above to redirect the user back to the help center.

Optional Login

If you don’t want to enforce login, disable the "Enforce login in the help center" toggle. This will display a login button at the top of the help center, allowing users to choose whether to log in or not.

Did this answer your question?
😞
😐
😁