LogoLogo
LanguageHomeContact Support
  • Introduction
    • Welcome to Mampu AI 🌟
    • Finding Answer/Get Support
    • Subscribing Plan
  • Getting Started
    • Introduction
    • Define Your Objectives
    • Building Your Chatbot
    • Sustaining Success
  • CHATBOT FOR BEGINNERS
    • Introduction
    • What is a chatbot?
    • Channels
    • Benefits & Importance
    • Use Cases
  • PLATFORM
    • Signing Up (Website and App)
      • Platform Overview
      • Dashboard Interface
      • Navigation
      • Change Language
    • Connect to Social Media Channels
      • Facebook
        • FB Engagement Ads Button Setup
      • Instagram
      • Normal WhatsApp vs WhatsApp Cloud
        • WhatsApp Cloud (WhatsApp API)
        • Normal WhatsApp (WhatsApp Business/Personal APP)
          • Reconnect WhatsApp Bot (Troubleshooting QR Code & Connection Issues)
        • Finding the receipt for conversational cost for WhatsApp API
      • Telegram
    • WebChat Widget
      • Web app installation using Custom User ID method
  • FLOW BUILDER
    • Bot Page Overview
    • Field Variable
    • Basic Block of Flow Builder
      • Advanced Action - External Request (Custom integration)
    • Sub Flows
      • Sub Flow
      • Workflow
      • Function Flow
  • Artificial Intelligence
    • OpenAI | ChatGPT
      • Temporary AI key
      • Getting new/permanent OpenAI key
      • FAQ AI (Embedding)
        • Adding Information (1 by 1 / batch)
        • Updating Information
        • Uploading Media
        • Including Media
        • How to Get the Best Results from Your AI Chatbot
        • Using embedding in AI
  • Users
    • Live Chat
      • Add New User
      • How to stop automation
      • AI Reply Assist for Live Agent
      • Assign Collaborator
    • Bot User
      • Bulk Import Users
  • Bot Automation
    • Keywords
    • Triggers
  • Contents
    • Create Custom user field & Usage
    • Tagging and Labelling
      • Creating Tags for Users
  • Tools
    • Error Logs
    • Tester
    • Admins
    • Quick Reply/Shortcut Reply
  • Broadcasting
    • General broadcast / Blasting
      • Creating WhatsApp Message Template for WhatsApp Official
  • Easy Guide to Build Chatbot
    • Premium Template
      • FAQ
      • Persuasion AI
        • Insert Info (Persuasion AI)
    • Recording AI Performance and Reporting
    • Notifying Group
      • Telegram Group
    • Intent (Yes/No) AI
  • Self onboarding
    • Self-Onboarding Guide
      • 1. Getting Started
      • 2. API and Integration Setup
      • 3. Integrating External Services
      • 4. Bot Configuration and Setup
      • 5. Finalizing Setup and Support
    • Basic AI Chatbot Tutorial
      • 1. Choosing Channel
      • 2. Creating a New Bot
      • 3. Installing Template
      • 4. Edit Template
      • 5. Getting AI API Key
      • 6. Testing the AI
  • Channel-Specific Automation Guide
    • Facebook
      • Facebook Post Comment Capture
      • How to Change Conversation Starter Message in Facebook Messenger (via Chatku AI)
  • Miscellaneous
    • Mampu AI Basement Parking
    • WHATSAPP ULTIMATE GUIDE
      • How to request for review to unban their account
      • How to warm up WhatsApp account
      • How to delete WhatsApp Account
Powered by GitBook

@ 2024 Mampu AI

On this page
  • Set Custom User ID
  • Access “Set Custom User ID” Feature
  • Special Key
  • Identifier Hash
  • Snippet Code

Was this helpful?

  1. PLATFORM
  2. WebChat Widget

Web app installation using Custom User ID method

PreviousWebChat WidgetNextBot Page Overview

Last updated 9 months ago

Was this helpful?

Set Custom User ID

ChatkuAI 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 omni bot, click on “Webchat Widget Settings” then click on “Display Style” tabs and then “Set Custom User ID”

The setup will look like the following:

Special Key

The special key is a set of strings that ChatkuAI uses to decrypt the hash you send to it from your website. This is important as it allows ChatkuAI 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 ChatkuAI 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 ChatkuAI otherwise the request will be denied. A sample code written in PHP for such an encryption can be found below:

$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.

<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.