Add chatbot to website: where the code goes, platform by platform
To add chatbot to website pages you need three things: a chatbot that runs as a hosted service, one short snippet of JavaScript, and a place on your platform that accepts it. This guide covers all three, then where the snippet goes on the common website builders, on plain HTML sites and through Google Tag Manager.
We make Life Inside, an AI Chat Agent that installs this way, so the examples use our snippet. The steps work the same for most chat widgets. If you would rather have us do it with you, book a demo.
Every platform
- HubSpot chatbot
HubSpot chatbot options compared: when HubSpot's own chatflows are enough, and how to add an AI chat agent whose leads land in HubSpot CRM.
- Shopify AI chatbot
Add an AI chatbot to your Shopify store: theme.liquid before the closing body tag, or a Custom Liquid section in the theme editor. Steps, checks, FAQ.
- WordPress AI chatbot
Add an AI chatbot to WordPress with one footer snippet: WPCode or your theme on WordPress.org, and the WordPress.com plans that allow custom code.
- Webflow chatbot
Add an AI chatbot to Webflow with one snippet in Footer code. Which plans allow custom code, the exact clicks, how to test it and what the agent does.
- Squarespace chatbot
Add an AI chatbot to Squarespace with Code Injection: which plans allow it, the exact clicks on 7.1 and 7.0, how to test it and how to limit it to some pages.
- Wix chatbot
Add an AI chatbot to Wix with Custom Code in your site Settings. What you need first (premium plan, connected domain), the exact steps and how to test it.
What you need before you start
- A chatbot that gives you a snippet. Hosted chat tools, Life Inside included, run on the vendor's servers and hand you a few lines of code with your own ID in them.
- Access to the place where custom code goes: a site settings page, a theme file or a tag manager, with a role that may edit and publish.
- The right plan on your website builder. Several builders only accept custom JavaScript on paid plans.
- Content for the bot to answer from: pages, documents and FAQs you approve.
- A route to a person: the contact page or booking link the bot sends people to when a question needs a human.
How embedding a chatbot in a website works
When you embed a chatbot in a website with a snippet, the code does one job: it loads the vendor's widget script, which draws the chat button on top of your page. The conversation runs on the vendor's service, not on your web server, so nothing changes on your server.
Life Inside's snippet adds the widget script with the async attribute, so the browser keeps loading your page while the widget loads. It also attaches the widget to the page body, so it goes in the footer, just before the closing body tag. Put it there once in a site-wide setting and it covers every page.
People also search for how to embed ChatGPT in website chat. What a business usually needs is narrower: answers only from its own approved content, a clear AI disclosure and a route to a human. That is the layer a website chat agent adds on top of the language model.
Where the code goes on common platforms
Each guide has the exact menu names, the plans that allow custom code and how to limit the agent to some pages.
- WordPress: a header and footer plugin such as WPCode, under Code Snippets > Header & Footer > Footer, or a child theme. WordPress.com needs a paid plan with hosting features activated.
- Shopify: theme.liquid in the layout folder, just above the closing body tag, or a Custom Liquid section in the footer from the theme editor.
- Webflow: Site settings > Custom code > Footer code. Needs a Site plan or a paid Workspace.
- HubSpot: Settings > Content > Pages > Site Footer HTML for HubSpot-hosted pages. The guide also covers when HubSpot's own chatbot is enough.
- Squarespace: Pages panel > Custom Code > Code Injection > Footer. Needs a Core, Plus or Advanced plan, or a legacy Business or Commerce plan.
- Wix: Settings > Custom Code, placed at Body - end. Needs a premium site plan and a connected domain.
Plain HTML sites and custom builds
On a hand-built site, paste the snippet just before the closing body tag. If your pages share a footer include or a layout template, put it there once rather than on every page. In a JavaScript framework, add it in the root layout so it loads once for the whole site.
If your site sends a Content Security Policy header, it must allow the inline snippet and the widget's domains, or the browser blocks the script. Ask Life Inside for the domains to add.
Adding a chatbot with Google Tag Manager
If Google Tag Manager is already on your site, you can add the snippet as a tag and skip the website builder entirely. Google recommends built-in tag templates where one exists; for code from a vendor without a template, the Custom HTML tag is the route Google documents.
- In your container, click Tags, then New.
- Click Tag Configuration and select Custom HTML.
- Paste the Life Inside snippet into the HTML field, script tags included.
- Under Triggering, choose the All Pages trigger, or a page view trigger limited to the pages you want.
- Save the tag, click Submit, keep Publish and Create Version selected and click Publish.
Test it before you tell anyone
- Open the live site in a private browser window, so you see what a visitor sees rather than a logged-in or cached version.
- Look for the widget. Life Inside appears in a bottom corner of the page.
- Ask a question your content answers, then one it should not know. A good agent says it does not know and points to the right contact.
- Check on a phone as well as a computer, and visit a page where you left the widget out.
- Confirm the conversation shows up in your analytics. For Life Inside that is AgentLoop.
Privacy: cookies, hosting and disclosure
Ask every chat vendor three questions: does the widget set cookies, where is conversation data hosted, and is there a data processing agreement.
For Life Inside the answers are short. The website widget sets no cookies. Data is hosted in the EU, encrypted with AES-256 at rest and TLS 1.3 or newer in transit, and never shared with third parties. There is a data processing agreement and a dedicated Data Protection Officer, and the agent tells visitors clearly that they are talking to AI. More on our GDPR page.
Where Life Inside fits
The Life Inside AI Chat Agent answers from the content you approve, in more than 60 languages, and books meetings or sends visitors to the right page or job. It can show interactive video of real people in the same window. AgentLoop shows what visitors asked and where the knowledge gaps are, and pushes leads to HubSpot or Salesforce.
It is not a live chat inbox where your team takes over conversations. If that is what you need, a live chat tool fits better; our alternatives guide compares the options honestly. Most agents go live within a day, and Life Inside builds the knowledge base with you. Plans are on the pricing page; to see it on your own site, book a demo.
Frequently asked questions
Sources
- Google Tag Manager Help: Custom tags (Checked 2026-10-27)
- Google Tag Manager Help: Publishing, versions and approvals (Checked 2026-10-27)
- Google Tag Manager Help: Page view trigger (Checked 2026-10-27)
- MDN Web Docs: the script element and the async attribute (Checked 2026-10-27)
- WordPress.com Support: Add code to headers (Checked 2026-10-27)
- Shopify Help Center: Editing theme code (Checked 2026-10-27)
- Webflow Help Center: Custom code in head and body tags (Checked 2026-10-27)
- HubSpot Knowledge Base: Use code snippets with HubSpot content (Checked 2026-10-27)
- Squarespace Help Center: Customize parts of your site with code injection (Checked 2026-10-27)
- Wix Help Center: Embedding custom code on your site (Checked 2026-10-27)
Updated 2026-10-27