Skip to main content

Script Tag Embed

Add your chatbot to any website with a single line of code.

Getting the Embed Code

  1. Go to your dashboard
  2. Select a chatbot
  3. Click Settings > Integration
  4. 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

  1. Go to Appearance > Theme Editor
  2. Edit footer.php
  3. Add the script before </body>

Or use a plugin like "Insert Headers and Footers" to add the script.

Shopify

  1. Go to Online Store > Themes
  2. Click Actions > Edit code
  3. Open theme.liquid
  4. Add the script before </body>

Squarespace

  1. Go to Settings > Advanced > Code Injection
  2. Add the script in the Footer section

Wix

  1. Go to Settings > Advanced > Custom Code
  2. 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

  1. Open your website in a browser
  2. Look for the chat bubble in the corner
  3. Click to open and send a test message
  4. 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