Identifying Logged-In Users in Livechat Widget

This guide helps your team get more value from TurboHelp's Live Chat tools. Use it to understand the feature, configure it correctly, and know what to check before relying on it in your daily support workflow.

At a Glance

  • Use the live chat widget to support visitors in real time without forcing them to leave your site.

  • Configure identity, routing, forms, and campaigns before driving production traffic to the widget.

  • Test the widget on desktop and mobile after every meaningful configuration change.

Authenticate live chat widget users via an email from your website or system. This links their full conversation history and data to their profile, making it accessible across devices. You can also enrich their profile with custom data, providing your agents with helpful context during conversations.

Warning: It's highly recommended to also enforce identity verification to prevent user impersonation by bad actors.

How It Works

You can include user email and other information about them by including a snippet before loading live chat widget. This snippet defines a window.BeChatSettings object containing the user's details. The chat widget then automatically reads this information when it loads.

This process eliminates the need for users to fill out a pre-chat form and for agents to ask for basic details like name and email.

Implementation Guide

To get started, you'll need to add the following JavaScript code to your website.

Code Snippet

window.BeChatSettings = {
   user: {
    name: 'John Appleseed',
    email: '[email protected]',
    language: 'en',
    subscriptionPlan: 'Premium',
    company: 'Pixel Perfect Designs'
  }
}

<script src="https://your-turbohelp-domain.com/livechat-loader.js"></script>

Important: This snippet must be placed before the main chat loader script (livechat-loader.js).

Breakdown of the user Object

  • name: (Optional) The full name of the logged-in user. This will be displayed to the agent as the visitor's name.

  • email: The user's email address. This will be the main identifier for the user.

  • language: Primary language for user. If not provided TurboHelp will detect this based on user location, browser settings or message content.

  • other: add any other custom key:value pairs to send any custom attributes you want. This is perfect for passing along key information that gives your support team more context. Common examples include:

    • Subscription level (e.g., 'Free', 'Premium')

    • Company name

    • Cart value

Tip: You'll need to dynamically populate the values for user object with the actual information of the currently logged-in user. This is typically done using a server-side language (like PHP, Python, or Node.js) to insert the user details into the JavaScript before the page is sent to the browser.

Benefits of Identifying Users

  • For Agents: Get instant context about who they're talking to. See important data like subscription plans or account IDs right in the conversation view, leading to quicker and more effective support.

  • For Users: Enjoy a seamless and frictionless experience. They don't have to waste time providing information they've already given you by logging in.

Best Practices

  • Keep the first widget experience short: ask only for the information agents truly need.

  • Verify identity for logged-in users before exposing account-specific conversation history.

  • Check widget behavior on key pages after changing themes, forms, or security rules.

Have more questions? Can't find what you're looking for? Our support team is here to help.
Submit a request We usually reply within 24 hours