Website Embedding
Last updated: November 29, 2025
Add the SimpleChat widget to any website with our simple embed code. This guide covers various platforms and advanced configurations.
- Go to Bot Studio
- Click Get Code in the top bar
- Copy the embed code
Your code looks like:
<script src="https://bot_xxx.w.simplechat.bot/widget.js"></script>
Add before the closing </body> tag:
<!DOCTYPE html>
<html>
<head>
<title>Your Website</title>
</head>
<body>
<!-- Your content -->
<!-- SimpleChat Widget -->
<script src="https://bot_xxx.w.simplechat.bot/widget.js"></script>
</body>
</html>
Option 1: Theme Editor
- Go to Appearance > Theme Editor
- Select footer.php
- Add code before
</body> - Save
Option 2: Plugin (Recommended)
- Install "WPCode" or "Insert Headers and Footers"
- Go to plugin settings
- Add code to "Footer" section
- Save
- Go to Online Store > Themes
- Actions > Edit Code
- Open theme.liquid
- Add code before
</body> - Save
- Go to Settings
- Click Custom Code
- Add Custom Code
- Paste your embed code
- Set placement: Body - End
- Apply to: All Pages
- Save
- Settings > Advanced
- Click Code Injection
- Paste in Footer section
- Save
- Project Settings > Custom Code
- Add to Footer Code section
- Publish site
Using Script component:
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"
/>
</>
)
}
Using useEffect:
import { useEffect } from 'react';
function App() {
useEffect(() => {
const script = document.createElement('script');
script.src = 'https://bot_xxx.w.simplechat.bot/widget.js';
script.async = true;
document.body.appendChild(script);
return () => {
document.body.removeChild(script);
};
}, []);
return <YourApp />;
}
In your main App.vue or index.html:
<script src="https://bot_xxx.w.simplechat.bot/widget.js"></script>
Or dynamically:
<script>
export default {
mounted() {
const script = document.createElement('script');
script.src = 'https://bot_xxx.w.simplechat.bot/widget.js';
document.body.appendChild(script);
}
}
</script>
- Go to Tags > New
- Choose Custom HTML
- Paste your embed code
- Set trigger: All Pages - Page View
- Submit and Publish
Load widget after page is ready:
<script>
window.addEventListener('load', function() {
setTimeout(function() {
var script = document.createElement('script');
script.src = 'https://bot_xxx.w.simplechat.bot/widget.js';
document.body.appendChild(script);
}, 2000); // 2 second delay
});
</script>
Show widget only on certain pages:
<script>
if (window.location.pathname.includes('/contact')) {
var script = document.createElement('script');
script.src = 'https://bot_xxx.w.simplechat.bot/widget.js';
document.body.appendChild(script);
}
</script>
Pass user info to widget:
<script>
window.SimpleChatConfig = {
userName: 'John Doe',
userEmail: 'john@example.com'
};
</script>
<script src="https://bot_xxx.w.simplechat.bot/widget.js"></script>
After adding the code:
- Clear cache - Browser and any CDN cache
- Visit your website - In incognito mode preferably
- Look for the widget - Bottom right corner
- Test functionality - Send a test message
Check these:
- Code is before
</body>tag - No JavaScript errors (F12 > Console)
- Bot is active (not paused/deleted)
- Browser cache cleared
Common Issues:
- Content Security Policy blocking script
- Ad blocker interfering
- Theme/plugin conflicts
Check:
- Internet connection
- Telegram group configured
- Bot subscription active
Cause: Code added multiple times
Fix: Remove duplicate embed codes
Use lazy loading to not affect page speed:
<script>
window.addEventListener('load', function() {
var script = document.createElement('script');
script.src = 'https://bot_xxx.w.simplechat.bot/widget.js';
script.async = true;
document.body.appendChild(script);
});
</script>
Load when user scrolls to bottom:
<script>
if ('IntersectionObserver' in window) {
const footer = document.querySelector('footer');
const observer = new IntersectionObserver((entries) => {
if (entries[0].isIntersecting) {
var script = document.createElement('script');
script.src = 'https://bot_xxx.w.simplechat.bot/widget.js';
document.body.appendChild(script);
observer.disconnect();
}
});
observer.observe(footer);
}
</script>
- Widget loads over HTTPS
- No sensitive data exposed
- Cross-origin security handled
- Safe to use on any domain