Guide
How to add an AI chatbot to any website: WordPress, Shopify, Wix, Squarespace or custom
Every website builder has its own way of adding a chatbot, and most guides stop at “paste this code”. This one covers the method for each platform, then the details that decide whether the chatbot is fast, secure and legal: where the script goes, Content Security Policy and cookie consent.
The short answer
- To add an AI chatbot to any website, install it the way your platform supports: a plugin on WordPress, an app embed on Shopify, an App Market app or Custom Code on Wix (Premium plan with a connected domain), or Code Injection on Squarespace (Core plan or higher).
- On any other site, paste a script tag before </body>, optionally through Google Tag Manager.
- Load the script with
asyncordefer, and allow its domains in your Content Security Policy. - Set it up to answer only from your own content.
Method by platform
| Platform | How | What you need |
|---|---|---|
| WordPress | Install a chatbot plugin | Any plan where you can install plugins |
| Shopify | Install an app, then turn on its App embed in the theme editor | Any Shopify plan |
| Wix | An App Market app, or Settings → Custom Code | Custom Code needs a published site with a connected domain (a Premium plan) |
| Squarespace | Settings → Code Injection → Footer | Core, Plus, Advanced or some legacy plans |
| Any other site | Paste the script before </body>, or add it through Google Tag Manager | Access to your site’s HTML or to GTM |
Detailed guides: WordPress, Shopify, Wix. For other sites, see HolaReply for any website.
Where the script goes
A hosted chatbot usually gives you one script tag. Put it just before the closing </body> tag, or in the head with the async or defer attribute so it doesn’t block the page:
- async downloads the script alongside the page and runs it as soon as it arrives.
- defer downloads it alongside the page and runs it after the page has been parsed.
On Squarespace, the Footer code injection field is placed before </body> on every page (Squarespace notes that checkout pages don’t support code). On Wix, choose “Body – end” in Custom Code.
Using Google Tag Manager
Create a tag
In GTM: Tags → New → Tag Configuration → Custom HTML.
Paste the chatbot code
Keep the JavaScript inside <script> tags, as Google requires.
Trigger it on all pages
Or only on the pages where you want the chat.
Preview, then publish
Test in GTM’s preview mode before publishing the container.
Google recommends built-in tag templates over Custom HTML where one exists, to avoid performance and security issues. On Wix, Google Tag Manager is connected through Wix’s marketing integrations, not Custom Code.
Keep your site fast
- Load the chat script with async or defer, or at the end of the page.
- Consider a “facade”: a lightweight button that looks like the chat and loads the real widget only when clicked. Google’s Lighthouse lists live-chat widgets as a typical case for facades.
- Test a key page in PageSpeed Insights before and after adding the chatbot.
Security headers (Content Security Policy)
If your site sends a Content Security Policy header, the chatbot won’t load until you allow it. Typically you add the vendor’s script domain to script-src, its API or websocket host to connect-src, and any iframe host to frame-src. Ask the vendor for the exact list.
Cookies and consent
Chat widgets often store a session identifier in the browser. Under the UK and EU rules, storage is exempt from consent only when it is strictly necessary for a service the visitor asks for; any secondary use, such as analytics or marketing, needs consent. Check what the widget stores and why, and categorise it honestly in your cookie banner. Our GDPR compliant chatbot checklist covers consent in more detail.
Make it answer from your content, not the internet
Adding the chatbot is the easy part. Before you switch it on, make sure it answers only from your own pages and notes, shows the source, says when it doesn’t know, keeps prices and other risky topics for a person, and turns questions it can’t answer into enquiries you receive. Our guide to training a chatbot on your website content covers this step by step.
See it on this site. The chat on this page is HolaReply, answering only from this website. Ask it where it works today.
“Which platforms does HolaReply support?”“Can I talk to someone?”
Open the chatQuestions people ask
Can I add an AI chatbot to my website for free?
Many chatbots have a free tier or a free plugin, and the platform method (plugin, app embed, custom code) is free on most plans. Wix Custom Code and Squarespace Code Injection need paid site plans.
Do I need to know how to code?
No. You paste one script, install a plugin or switch on an app embed. Security headers are the only step that may need your developer.
Will a chatbot slow my website down?
Not if the script loads with async or defer, or behind a facade that loads the widget on click. Test with PageSpeed Insights.
Can I add the chatbot with Google Tag Manager?
Yes, as a Custom HTML tag on most sites. On Wix, GTM itself is connected through Wix’s marketing integrations.
Does HolaReply work on any website?
Yes. On WordPress it is a free plugin; on Wix, Squarespace, Webflow and any other website it is one line of code, with a 7-day free trial. The Shopify app is coming soon to the Shopify App Store.
Sources
Checked on 25 September 2026. Prices and features change; tell us in the chat if something here is out of date and we will fix it.
- MDN: the script element (async and defer)
- Google Tag Manager: custom tags
- Chrome for Developers: lazy load third-party resources with facades
- MDN: Content Security Policy
- ICO: exceptions to the storage and access rules
- Shopify Help Center: apps in themes (App embeds)
- Wix: embedding custom code on your site
- Squarespace: using code injection
An AI assistant that never makes things up, wherever your site runs.
One line of code on Wix, Squarespace, Webflow or any website: 7 days free, no card. Free plugin for WordPress; Shopify app coming soon.
