Web Widget
Install and configure the AlonChat chat widget on your website
Web Widget#
Use the Web Widget to add a floating AlonChat chat bubble to your website. Setup, styling, embed code, and domain restrictions are all managed from Deploy > Chat widget.
Quick Start#
- Go to your agent dashboard.
- Click Deploy.
- Open Chat widget.
- Open the Embed tab.
- Copy the widget code shown in the dashboard.
- Paste it before the closing
</body>tag on your website.
The embed tab shows the exact code for your agent. It follows this pattern:
<script>
(function(){
const onLoad = function () {
const script = document.createElement("script");
script.src = "https://alonchat.com/embed.min.js";
script.id = "YOUR_AGENT_ID";
script.domain = "alonchat.com";
document.body.appendChild(script);
};
if (document.readyState === "complete") {
onLoad();
} else {
window.addEventListener("load", onLoad);
}
})();
</script>
The widget loads automatically and appears as a floating chat bubble on your site.
Chat Widget Tabs#
Inside Deploy > Chat widget, you will see four tabs:
| Tab | What you configure |
|---|---|
| Content | Greeting, display name, suggested messages, placeholder text, and lead capture |
| Style | Colors, theme, bubble position, profile image, and chat icon |
| AI | Widget-specific AI instructions and response behavior |
| Embed | Widget code, iframe code, allowed domains, and identity verification |
Dashboard Customization#
Customize the widget from Deploy > Chat widget:
- Open the Content tab for greeting text, placeholder text, suggested messages, and lead capture.
- Open the Style tab for colors, theme, and bubble alignment.
- Open the AI tab for channel-specific instructions.
- Open the Embed tab for widget code, iframe code, domain restrictions, and identity verification.
Appearance#
- Primary color -- Brand color for the widget
- Position -- Bottom-right or bottom-left
- Theme -- Appearance options configured from the Style tab
Text#
- Greeting -- Initial greeting message
- Placeholder -- Input field placeholder text
- Title -- Widget header title (defaults to agent name)
- Subtitle -- Widget header subtitle
Behavior#
- Auto-show initial message -- Show the first message automatically after a delay
- File uploads -- Let visitors upload files when enabled
- Emoji picker -- Show or hide the emoji picker
Suggested Messages#
- Add quick-reply buttons visitors can tap when the widget opens
- Use them to guide first questions and common actions
Lead Capture#
Collect visitor information before or during chat:
- Go to Deploy > Chat widget.
- Open the Content tab.
- Use the Lead capture card to turn lead capture on or open its settings.
- Configure the fields and choose when the form should appear.
Domain Restrictions#
Restrict the widget to only work on specific domains:
- Go to Deploy > Chat widget > Embed.
- Turn on Allowed domains.
- Add each domain you want to allow, such as
yoursite.comorshop.yoursite.com. - Copy the embed code after your domain list is set.
If no domains are configured, the widget can be embedded on any website where the code is added.
Platform-Specific Installation#
WordPress#
- Go to Appearance > Theme Editor
- Select footer.php (or use a plugin like "Insert Headers and Footers")
- Paste the widget code before
</body> - Save changes
Shopify#
- Go to Online Store > Themes > Actions > Edit Code
- Open Layout > theme.liquid
- Paste the widget code before
</body> - Save
Wix#
- Go to Settings > Custom Code
- Click + Add Custom Code
- Paste the widget code
- Select "Body - end" placement and apply to all pages
- Publish site
Any HTML Website#
Paste the widget code before the closing </body> tag:
<!DOCTYPE html>
<html>
<head>
<title>Your Website</title>
</head>
<body>
<!-- Your website content -->
<!-- AlonChat Widget -->
<script>
/* Paste the widget code from Deploy > Chat widget > Embed here */
</script>
</body>
</html>
Testing#
Before going live:
- Install the widget code on a test page.
- Verify the chat bubble appears in the correct corner.
- Click the bubble to open the widget.
- Send a test message and verify the agent responds.
- Test on a mobile device.
- Verify the lead form works if enabled.
- Check that conversations appear in your AlonChat dashboard.
Troubleshooting#
Widget Not Loading#
- Check the embed code -- Make sure you pasted the exact code from Deploy > Chat widget > Embed
- Check browser console -- Open developer tools (F12) and look for errors in the Console tab
- Allowed domains -- If you configured allowed domains, make sure the current domain is listed
- Ad blockers -- Some ad blockers may block third-party scripts
Widget Not Responding#
- Agent is trained -- Ensure your agent has been trained with knowledge base content
- Agent has credits -- Check your credit balance in Billing
- Test in Playground -- Test the same question in the Playground first to rule out widget-specific issues
Wrong Colors or Styling#
- Cache -- Clear your browser cache or try in an incognito window
- Check the Style tab -- Confirm your saved values in Deploy > Chat widget > Style
Mobile Issues#
- Test on real devices -- Browser emulators do not always match real behavior
- Widget overlap -- If the widget overlaps with other elements, change the bubble position in the Style tab
Best Practices#
- Match the widget to your brand colors.
- Write a clear greeting message.
- Add suggested messages for common first questions.
- Configure allowed domains before sharing the code.
- Test on desktop and mobile before going live.
Next Steps#
- Lead Capture -- Collect visitor information
- Help Page -- Create a standalone help center
- Embedding Guide -- More integration options
- Identity Verification -- Identify logged-in users in the widget