Getting Your Embed Code
The embed code is available from your agents deployment page in the Humanizing Agents dashboard.Basic Embedding
Add the following script to your website, typically just before the closing body tag:Embedding Methods
Method 1: Script Tag (Recommended)
The simplest method - works with any website:Method 2: Dynamic Loading
Load the widget after page load for better performance:Configuration Options
Configure the widget behavior using data attributes:| Attribute | Type | Description |
|---|---|---|
| data-agent-id | string | Required. Your agent ID from the dashboard |
| data-position | string | Widget position: bottom-right (default), bottom-left |
| data-open-on-load | boolean | Auto-open widget when page loads |
| data-hide-button | boolean | Hide the floating chat button |
Verifying Your Installation
After adding the embed code:- Clear your cache - Ensure you are seeing the latest version of your site
- Look for the chat button - A floating button should appear in the corner
- Click to open - The chat interface should open smoothly
- Test a conversation - Send a test message to verify the connection
Troubleshooting
Widget not appearing
Widget not appearing
- Verify the agent ID is correct
- Check that your agent is deployed (not in draft mode)
- Ensure no JavaScript errors in the console
- Check for CSS conflicts with z-index
CORS or network errors
CORS or network errors
- Verify your domain is allowed in agent settings
- Check that your site uses HTTPS
- Ensure no ad blockers are interfering
Mobile display issues
Mobile display issues
- The widget is designed to be responsive
- Avatar panel is hidden on mobile (expected behavior)
- Check viewport meta tag is present
Security Considerations
The widget only works on domains you have authorized in your agent settings. Unauthorized domains will see a connection error.
- Always use HTTPS on your website
- Keep your agent ID confidential (though it is visible in page source)
- Configure allowed domains in the dashboard