Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Below is an example of the embed chat window;

...

Set Custom User ID

Chat now allows its users to pass bot user information from their website directly into the omnichannel bot via setting a custom user ID. This feature will enable users to send specific flows to guest users vs users who have given their information as well as be able to fetch chat history and other user specific flows which was not possible before.

Access “Set Custom User ID” Feature

Inside the omnibot, click on “Webchat Widget Settings” then click on “Display Style” tabs and then “Set Custom User ID”

Image Added

The setup will look like the following:

Image Added

Special Key

The special key is a set of strings that UChat uses to decrypt the hash you send to it from your website. This is important as it allows UChat to verify that the user is indeed created from your website and is authorized and authentic.

Identifier Hash

Identifier hash is a set of string composed of the user ID you want to set which is then encrypted to string using SHA256 algorithm with HMAC enabled. This hash is the unique signature that UChat then verifies to confirm and authorize that the request is being made from your website.

This hash needs to be created from the backend of your website. You will have to send this value in its encrypted form to UChat otherwise the request will be denied. A sample code written in PHP for such an encryption can be found below:

Code Block
$identifier_hash = hash_hmac('sha256', $user_id, 'b02612a8bdf5e736c41ce2002181d124');

Snippet Code

The code snippet for this will have to be pasted in the same area where you put the code snippet for the bot itself i.e in the header section of your website.

The snippet code contains the payload for the user details, along with mandatory fields of user_id and identifier hash.

Code Block
<script>

  window.addEventListener("chatbot:ready", function () {

    window.$chatbot.setUser("{user_id}", {

      name: "full name",

      email: "user@email.com",

      identifier_hash: "{identifier_hash}"

    });

  });

</script>

Here, you can enter custom details for users such as name and email, as well as you can set the user_id.

Note: The {user_id} and {indentifier_hash} variables need to be replaced with the variables where the values you want to set can be mapped.

Instructions

  1. Copy the snippet code into the header of your website, the same place where you place the snippet code for the bot itself.

  2. Replace the {user_id} variable with the custom user_id you want to set for the user. The value for this will most likely have to be fetched from your server or website’s backend.

  3. Using the same user_id, create the identifier hash from your server or website’s backend using SHA256 algorithm with HMAC enabled.

  4. Copy both to the snippet code, then publish it live to your website. You will then be able to create users with custom user IDs.

...

Custom CSS

You can add your own custom CSS to customerize the web chat interface.

...

Frequently Asked Questions:

  1. Can I change the footer of the web chat widget?

  2. Can webChat widget be opened by default without click?