Embed on Your Website
Once your chatbot is set up and tested, you can add it to your website by pasting a simple code snippet. The chat widget will appear as a floating button in the corner of your page.Getting Your Embed Code
Copy your embed code
You’ll see a ready-to-use code snippet. Click the Copy button to copy it to your clipboard.
The Embed Code
Your embed code looks something like this:data-chatref-token value is unique to your agent — it tells Chatref which chatbot to load.
Where to Place the Code
Add the embed code just before the closing</body> tag in your website’s HTML. This ensures the widget loads after your page content, keeping your site fast.
Common Platforms
HTML websites: Paste the code directly into your HTML file before</body>.
WordPress:
Add the code to your theme’s footer, or use a plugin that lets you add custom scripts to the footer area.
Shopify:
Go to Online Store > Themes > Edit Code, and add the snippet to your theme.liquid file before </body>.
Squarespace:
Go to Settings > Advanced > Code Injection, and paste the code in the Footer section.
Wix:
Use the Custom Code feature under Settings > Advanced to add the snippet.
React / Next.js:
Add the script tag to your root layout or use a Script component to load it.
Your API Key and Secret
The Deploy tab also shows your API Key and Secret for this agent. These are used for:- Embedding the chatbot on your website
- API integrations
- Widget configuration
Testing the Embed
After adding the code to your website:- Visit your website in a browser
- Look for the chat bubble button in the bottom-right corner
- Click it to open the chat widget
- Send a test message to make sure everything works