Script Tag Embed
Add your chatbot to any website with a single line of code.
Getting the Embed Code
- Go to your dashboard
- Select a chatbot
- Click Settings > Integration
- Copy the script tag code
Basic Installation
Add this code before the closing </body> tag on your website:
<script src="https://leezy.ai/embed.js?chatbot_id=YOUR_CHATBOT_ID"></script>
Replace YOUR_CHATBOT_ID with your actual chatbot ID.
Find Your Chatbot ID
Your chatbot ID is shown in Settings > General and in the Integration tab.
Where to Add the Code
Static HTML
Add before </body>:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<!-- Your website content -->
<!-- Leezy Chat Widget -->
<script src="https://leezy.ai/embed.js?chatbot_id=YOUR_CHATBOT_ID"></script>
</body>
</html>
WordPress
- Go to Appearance > Theme Editor
- Edit
footer.php - Add the script before
</body>
Or use a plugin like "Insert Headers and Footers" to add the script.
Shopify
- Go to Online Store > Themes
- Click Actions > Edit code
- Open
theme.liquid - Add the script before
</body>
Squarespace
- Go to Settings > Advanced > Code Injection
- Add the script in the Footer section
Wix
- Go to Settings > Advanced > Custom Code
- Add the script and set placement to "Body - end"
Next.js / React
Add to your root layout or _app.js:
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Script
src="https://leezy.ai/embed.js?chatbot_id=YOUR_CHATBOT_ID"
strategy="lazyOnload"
/>
</body>
</html>
)
}
Widget Behavior
Once installed, the chat widget:
- Appears in the bottom-right corner (or your configured position)
- Opens when users click the chat button
- Maintains conversation history during the session
- Adapts to mobile devices automatically
Customization Options
Widget appearance is controlled in Settings > Interface:
- Theme (Light/Dark/System)
- Position (Bottom Right/Left)
- Brand color
- Initial message
- Display name
Verify Installation
- Open your website in a browser
- Look for the chat bubble in the corner
- Click to open and send a test message
- Check your dashboard for the conversation
Troubleshooting
Widget Not Appearing
- Check the console: Open browser Developer Tools (F12) and look for errors
- Verify the ID: Make sure the chatbot ID is correct
- Check script placement: The script should be before
</body> - Clear cache: Your browser may be caching the old page
Widget Appears But Doesn't Respond
- Check chatbot status: Make sure the chatbot is Active in settings
- Verify training: Ensure you have training data added
- Check quota: You may have exceeded your message limit
Styling Conflicts
If the widget looks wrong:
- Check for CSS that might affect all buttons or iframes
- The widget uses an iframe, so most styles shouldn't affect it
- Contact support if issues persist
Security
The embed script:
- Loads from Leezy's secure CDN
- Uses iframe sandboxing for security
- Validates message origins
- Does not access your website's data
Next Steps
- iFrame Embed - Alternative embedding method
- Customize Interface - Change widget appearance
- View Analytics - Track widget usage