Adding your Ernie AI chatbot to a custom-built website is simple. If you or your developer can edit the site code, you can add Ernie in under a minute.
Before you start
Have your Ernie AI embed code ready.
Confirm you can edit the HTML files of your site.
We recommend adding Ernie at least on your homepage, then optionally across all pages.
Method A: Insert code directly into HTML
Open your website’s HTML file in your editor or codebase.
Find the closing </head> tag.
Paste your Ernie AI embed code directly above it.
Example placement:
<script>
[your ernie code here]
</script>
</head>
Save the file.
Deploy or refresh your site.
The chatbot should appear in the bottom-right corner on reload.
Method B: Insert using a template or shared layout
If your site uses reusable layout files (common in frameworks like React, Next.js, Laravel, Flask, Rails etc):
Locate the global layout or head template file.
Example names:layout.html
head.html
_document.js
base.twig
app.blade.php
Insert your embed snippet above the closing </head> tag.
Save, rebuild as needed, and redeploy.
Confirm the chatbot appears across all pages.
This method ensures Ernie appears site-wide.
Method C: Include using a shared footer file
Some sites inject scripts from the footer:
Locate your site footer include file.
Example names:footer.html
partials/footer.php
includes/_footer.ejs
Paste your Ernie AI embed snippet just before the closing body tag </body>.
Save and reload.
This works as well, but </head> is preferred.
Troubleshooting and checks
Chatbot doesn’t show → confirm snippet is exactly as provided.
File caching → hard refresh or clear CDN cache.
Only visible on some devices → test on desktop and mobile.
Only visible on homepage → move snippet to a global layout file.
Need help?
Email [email protected] with:
your site URL
where you inserted the snippet
any screenshots if needed