Web Widget
Embed a chat widget on your website
Web Widget#
Add an AI-powered chat widget to any website with a simple code snippet.
Quick Start#
Add this code to your website:
html
<script>
window.ALONCHAT_AGENT_ID = 'your-agent-id';
</script>
<script src="https://alonchat.com/widget.js"></script>
Replace your-agent-id with your actual agent ID (found in Settings).
Widget Options#
Configure the widget with additional options:
html
<script>
window.ALONCHAT_CONFIG = {
agentId: 'your-agent-id',
// Appearance
primaryColor: '#2563eb',
position: 'bottom-right',
// Text
greeting: 'Hi! How can I help you today?',
placeholder: 'Type your message...',
// Behavior
autoOpen: false,
showBranding: true
};
</script>
<script src="https://alonchat.com/widget.js"></script>
Configuration Options#
Appearance#
| Option | Description | Default |
|---|---|---|
primaryColor | Widget accent color | #2563eb |
position | bottom-right or bottom-left | bottom-right |
Text#
| Option | Description | Default |
|---|---|---|
greeting | Initial greeting message | "Hi! How can I help?" |
placeholder | Input placeholder text | "Type a message..." |
title | Widget header title | Agent name |
subtitle | Widget header subtitle | "" |
Behavior#
| Option | Description | Default |
|---|---|---|
autoOpen | Open widget on page load | false |
showBranding | Show AlonChat branding | true |
Customizing Appearance#
Via Dashboard#
- Go to Settings → Widget
- Customize colors, text, and position
- Preview changes
- Save
Via CSS#
Add custom CSS to your page:
css
/* Custom widget button color */
.alonchat-widget-button {
background-color: #your-color !important;
}
/* Custom chat window size */
.alonchat-widget-window {
width: 400px !important;
height: 600px !important;
}
Lead Capture#
Collect visitor information before chat:
- Go to Settings → Lead Form
- Configure required fields:
- Name
- Phone
- Custom fields
- Form shows before first message
Initial Messages#
Set suggested messages for users:
- Go to Settings → Widget → Suggested Messages
- Add up to 4 quick reply buttons
- Users can click to send instantly
Domain Restrictions#
Restrict widget to specific domains:
- Go to Settings → Widget → Allowed Domains
- Add domains (e.g.,
yoursite.com) - Widget only works on listed domains
Testing#
Before going live:
- Install on a test page
- Verify widget loads
- Test conversations
- Check mobile responsiveness
- Verify lead form works
Troubleshooting#
Widget not loading:
- Check if script is added correctly
- Verify agent ID is correct
- Check browser console for errors
Widget not responding:
- Verify agent is trained
- Check if agent has credits
- Test in playground first