Getting Your Embed Code
Last updated: November 29, 2025
Add SimpleChat to your website with a simple code snippet. This guide shows you how to get and install the embed code.
- Open Bot Studio for your bot
- Click Get Code in the top bar
- Modal appears with your embed code
- Click Copy to copy to clipboard
Your embed code looks like this:
<script src="https://bot_xxx.w.simplechat.bot/widget.js"></script>
Replace bot_xxx with your actual bot ID.
Add the code before the closing </body> tag:
<!DOCTYPE html>
<html>
<head>
<title>Your Website</title>
</head>
<body>
<!-- Your website content -->
<!-- SimpleChat Widget -->
<script src="https://bot_xxx.w.simplechat.bot/widget.js"></script>
</body>
</html>
- Go to Appearance > Theme Editor
- Open footer.php
- Paste code before
</body> - Save changes
Or use a plugin like "Insert Headers and Footers":
- Install the plugin
- Go to Settings > Insert Headers and Footers
- Paste in "Scripts in Footer"
- Save
- Go to Online Store > Themes
- Click Actions > Edit Code
- Open theme.liquid
- Paste before
</body> - Save
- Go to Settings > Custom Code
- Click Add Code
- Paste your embed code
- Place: Body - End
- Apply to: All Pages
- Save
- Go to Settings > Advanced > Code Injection
- Paste in "Footer" section
- Save
Add to your main layout or _app.js:
import Script from 'next/script'
export default function App({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
<Script
src="https://bot_xxx.w.simplechat.bot/widget.js"
strategy="lazyOnload"
/>
</>
)
}
Add to your main App.vue or index.html:
<script src="https://bot_xxx.w.simplechat.bot/widget.js"></script>
After adding the code:
- Visit your website
- Look for the chat button (bottom right)
- Click to open the widget
- Send a test message
Widget not appearing:
- Check code is before
</body> - Clear browser cache
- Check for JavaScript errors (F12 > Console)
- Verify bot is active (not paused/deleted)
Widget appears but doesn't work:
- Check internet connection
- Verify Telegram group is set up
- Check bot subscription status
The widget appears on every page where the code is installed:
- For all pages: Add to main layout/template
- For specific pages: Add only to those pages
- To exclude pages: Use conditional logic
Load widget after page is ready:
<script>
window.addEventListener('load', function() {
var script = document.createElement('script');
script.src = 'https://bot_xxx.w.simplechat.bot/widget.js';
document.body.appendChild(script);
});
</script>
Show widget only for certain users:
<script>
if (userIsLoggedIn) {
var script = document.createElement('script');
script.src = 'https://bot_xxx.w.simplechat.bot/widget.js';
document.body.appendChild(script);
}
</script>
- Code is safe to use on any website
- No sensitive data in the script URL
- Widget loads over HTTPS
- Cross-origin security handled
If you're having trouble installing:
- Check our troubleshooting guide
- Contact support with your website URL