Chatbot Standard Widget
The Standard Widget provides a customizable chat interface on your web page.
Quick Start
Here's the minimum code required to implement the Standard Widget:
<script type="module">
import Agent from 'https://cdn.jsdelivr.net/npm/@agent-embed/js@latest/dist/web.js'
Agent.initStandard({
agentName: "your assistant name", //generated on the predictable dialogs app
});
</script>
<agent-standard style="width: 100%; height: 600px; "></agent-standard>
User Information Capture
Capture user information for enhanced session tracking and personalization. All collected data appears in your session logs.
Basic Usage with User Information
<script type="module">
import Agent from 'https://cdn.jsdelivr.net/npm/@agent-embed/js@latest/dist/web.js'
Agent.initStandard({
agentName: "your assistant name",
user: {
user_id: "ab123",
user_name: "Abc Def",
user_email: "abc@example.com",
user_segments: ["sports", "ott"]
}
});
</script>
<agent-standard style="width: 100%; height: 600px;"></agent-standard>
Default Captured Information:
- IP address (automatic)
- Country (automatic)
Optional User Fields:
user_id- Unique identifier for the useruser_name- Display name of the useruser_email- User's email addressuser_segments- Array of tags for user categorization
For complete session tracking details, see the Sessions documentation.