How to Publish Your Chatbot
After setting up and testing your chatbot, it's time to publish it on your website. This guide shows you how to get the embed code and install it on various platforms.
Prerequisites
- A configured chatbot with FAQs or documents
- Tested in Playground - Verify it works before publishing
- Access to your website's HTML/code editor
Steps
Step 1: Open the Publish Tab
- Go to Chatbots in the sidebar
- Click on your chatbot to open it
- Click the Publish tab
Step 2: Copy the Embed Code
You'll see a code snippet that looks like this:
<script
src="https://app.chatflow.com/chatflow-chatbot.js"
data-chatbot-id="your-chatbot-id"
defer>
</script>
Click the Copy button to copy the entire code snippet to your clipboard.
Step 3: Install on Your Website
Paste the code into your website's HTML, just before the closing </body> tag.
<html>
<head>
<!-- Your head content -->
</head>
<body>
<!-- Your website content -->
<!-- Paste ChatFlow embed code here -->
<script
src="https://app.chatflow.com/chatflow-chatbot.js"
data-chatbot-id="your-chatbot-id"
defer>
</script>
</body>
</html>
WordPress
Option 1: Using Theme Editor
- Go to Appearance > Theme Editor
- Select your theme's
footer.php file
- Paste the code before
</body>
- Click Update File
Option 2: Using a Plugin
- Install "Insert Headers and Footers" plugin
- Go to Settings > Insert Headers and Footers
- Paste the code in the Footer section
- Click Save
For detailed steps, see WordPress Integration.
Wix
- Go to your Wix Dashboard
- Click Settings > Custom Code
- Click + Add Custom Code
- Paste your embed code
- Set placement to Body - End
- Click Apply
For detailed steps, see Wix Integration.
Shopify
- Go to your Shopify Admin
- Click Online Store > Themes
- Click Actions > Edit Code
- Open
theme.liquid
- Paste the code before
</body>
- Click Save
For detailed steps, see Shopify Integration.
Webflow
- Go to your Webflow project settings
- Click the Custom Code tab
- Paste the code in Footer Code
- Click Save Changes
- Publish your site
For detailed steps, see Webflow Integration.
Squarespace
- Go to Settings > Advanced > Code Injection
- Paste the code in Footer
- Click Save
Custom HTML/React/Next.js
For custom implementations, paste the script in your main HTML file or layout component.
React/Next.js Example:
// In your _app.js or layout.tsx
import Script from 'next/script'
export default function Layout({ children }) {
return (
<>
{children}
<Script
src="https://app.chatflow.com/chatflow-chatbot.js"
data-chatbot-id="your-chatbot-id"
strategy="afterInteractive"
/>
</>
)
}
Verify It's Working
Step 1: Visit Your Website
Open your website in a new browser tab (or incognito window for best results).
You should see the chat widget in the corner of your screen (default: bottom right).
Step 3: Test the Chatbot
- Click the chat widget to open it
- Send a test message
- Verify the response matches your expectations
Step 4: Check in ChatFlow Dashboard
- Go to Conversations in your ChatFlow dashboard
- You should see your test conversation appear
- This confirms the connection is working
Advanced Options
Multiple Pages
The embed code works across all pages where it's installed. For most CMS platforms, adding it to the theme/footer applies it site-wide.
Specific Pages Only
If you only want the chatbot on specific pages:
- Add the code only to those page templates
- Or use conditional logic in your code
Hiding on Certain Pages
To hide the chatbot on specific pages, you can add CSS:
/* Hide chatbot on pricing page */
.chatflow-widget { display: none !important; }
Or use JavaScript to control visibility based on URL.
Troubleshooting
- Check the code placement - Must be before
</body>
- Clear browser cache - Hard refresh (Ctrl+Shift+R)
- Check for JavaScript errors - Open browser console (F12)
- Verify chatbot ID - Ensure the ID matches your chatbot
- Check ad blockers - Disable them temporarily
- Test in Playground first - Ensure chatbot works in dashboard
- Check network requests - Look for failed API calls in console
- Verify domain - Some plans have domain restrictions
Code Not Saving
- Check permissions - You may need admin access
- Try a different method - Use a plugin instead of direct editing
- Contact platform support - They can help with code injection
Styling Conflicts
- Check z-index - Widget may be hidden behind elements
- Check CSS overrides - Your site CSS may affect the widget
- Inspect element - Use browser dev tools to diagnose
What's Next
After publishing, consider:
Need Help?