What does this feature do?
When someone chats on your website widget, their details (like name, email, mobile, or customer ID) are automatically passed securely in the background.
👉 The AI never sees these details directly.
👉 But when the chatbot needs to perform an action (like sending a message to Slack, creating a ticket, or updating CRM), these details are auto-filled at the last step to complete the task correctly.
✅This makes the chatbot smarter, faster, and more secure — without exposing private customer data.
🔄 How it Works (Simple Flow)
Widget Loads – The Hello Chat Widget is added to your site with your customer variables (like user_id, email, etc.).
User Chats – The customer types a query.
AI Decides Action – The bot prepares an action (like “send order details to CRM”) with placeholders.
System Fills Real Data – The system automatically replaces placeholders with the actual customer info.
Action Done – CRM/Slack/Ticket system receives the correct data, and the response is shown to the user.
🖥 How to Add Variables in Your Widget
<script type="text/javascript" src="https://ctest.msg91.com/chat-widget.js"></script>
<script type="text/javascript">
var helloConfig = {
widgetToken: "ccb0ddf",
variables: {
user_id: "1234",
jwt_token: "dGZO...",
mobile: "918987654310",
name: "codebro",
email: "[email protected]"
}
};
initChatWidget(helloConfig, 5000);
</script>
🔒 Privacy & Security
Customer info is never shared with AI.
Details are only inserted when sending data to a tool (CRM, Slack, Ticketing, etc.).
Everything happens server-side – fully secure.
🧩 Placeholder Example
Let’s say you stored user’s first name like this:
name: { "first_name": "Nauman", "last_name": "Khan" }
When you want to use this in a tool, you call:
{{name.first_name}}
👉 Example:
If the bot sends a Slack message → it will display:
“Nauman has raised a support ticket.”
📌 Example Tool Call: Send to Slack
User: “I need help with my order.”
Bot: Prepares Slack tool call → {{name.first_name}} needs support for Order ID {{user_id}}.
System replaces placeholders → Nauman needs support for Order ID 1234.
Slack gets the final message.
📊 Tool Requirements
Each tool (Slack, CRM, WhatsApp, etc.) may need specific variables.
Example: user_id, jwt_token, email.
If missing, default values can be set in the widget.
🧪 Testing Checklist
Check if variables are added in widget config.
Ensure placeholders like {{name.first_name}}
are resolving properly.
Validate required fields (like email, ID).
Test for error cases (e.g., missing variable).
🎯 Use Cases of This Feature
Here’s how businesses can benefit:
E-commerce
Customer Support
Sales Teams
Bot pushes lead info (name, email, phone) directly into CRM.
Makes follow-up faster with complete customer context.
Banking & Finance
Healthcare
Why This Matters
Customers love it → no repeated questions, smoother experience.
Your team saves time → details automatically flow into the right system.
Your data stays safe → AI doesn’t see sensitive info.
📌 Next Step: Add your widget with variables → Build AI Chatbot → Start automating secure, personalized conversations.