- To add live chat, you choose a chat tool, copy the short piece of code it gives you, paste it once into your site's site-wide code area, publish, and test it on a phone.
- Every major website builder has a place for that code: Custom Code on Wix, Code Injection on Squarespace, the site-level Custom Code settings on Webflow, and a header and footer plugin on WordPress.com. Some of these need a paid plan or a published site.
- Installing is the quick part. Decide your chat hours, greeting, answers and who picks up each chat before you turn it on.
How to add live chat to your website, in short
Adding live chat to a website takes five steps. Pick a chat tool and set up an account. Copy the short code snippet it gives you. Paste that snippet once into the part of your site that loads on every page, usually just before the closing body tag. Publish the site. Then open it on your phone and send yourself a test message.
On a website builder you never touch the page files: Wix, Squarespace, Webflow and WordPress.com each have a box for site-wide code, covered below. Many chat tools also offer a plugin or app that does the paste for you.
What decides whether the chat helps comes after the install: when it is staffed, what it says first and where each conversation goes. If you are still choosing between people and automation, read AI chatbot vs live chat first.
Decide four things before you install
The chat window appears the moment the code goes live, so settle these first.
- Who answers. Your staff, an AI agent working from your information, or the AI first with a person stepping in.
- When. The hours a person is watching, and what the window does outside them.
- Where chats land. One inbox your team already checks, with the visitor's name and number saved.
- What it can do. Answer questions, collect contact details, or book into your calendar.
Write the answers down where your team can see them. They become the chat's settings.
Adding the chat code, step by step
Every chat tool gives you a small block of code, usually a script tag, that draws the chat button and connects it to the tool. Your job is to put it on every page once.
- Copy the snippet from the chat tool, usually under install or embed. Copy all of it, including both script tags.
- Paste it in your site-wide code area, where your chat tool says. With no preference, the end of the body is the usual place for a widget, so the page shows first.
- Paste it once. Two copies can draw two buttons. If you used a plugin, skip the manual paste.
- Publish the site. On most builders site-wide code runs only on the live site, so the editor preview may not show the button.
- Check the live site in a private window on your phone and a computer, and send a test chat from each.
On a site built by hand, the snippet goes into the shared footer or template file every page uses, just above the closing body tag.
Where the code goes on popular website builders
Here is where each platform's own help pages say custom code goes. Menu names change, so if a label does not match, search the platform's help for custom code.
| Platform | Where to paste the chat code | Check before you start |
|---|---|---|
| Wix | Dashboard, Settings, then Custom Code under Development and integrations. Click Add Custom Code, paste, choose All pages, and set the placement to Body end unless your chat tool says otherwise. | The site must be published and have a connected domain. |
| Squarespace | Open the Code Injection panel and paste into the Footer field, which places code before the closing body tag on every page. | Code injection comes with the Core, Plus and Advanced plans and some legacy plans. It does not run on checkout pages. |
| Webflow | Site settings, Custom Code section. Paste into the head or the before-body area, following the chat tool's instructions. | Site-level code applies once the site is published. |
| WordPress.com | Install the free WPCode Insert Headers and Footers plugin, go to Code Snippets, Header and Footer, paste into the Footer box (or Header if your tool asks) and save. | Available on the Personal, Premium, Business and Commerce plans. Free sites need to upgrade first. |
On a self-hosted WordPress site, check whether your chat tool has its own WordPress plugin. If not, a header and footer plugin works the same way as on WordPress.com.
Set your chat hours and the after-hours reply
Set the hours a person is available to the hours your team will really watch the inbox. A chat that says someone is online and then sits for twenty minutes does more harm than a clear after-hours message.
Outside those hours the window can hide, which loses the visitor who was ready to ask; switch to a message form that promises a reply at a stated time; or hand the conversation to an AI agent that answers from your approved information and books into your calendar while the visitor is still on your site.
The hours in the chat must match your website, Google Business Profile and voicemail, including holidays.
Write the greeting and the first replies
The greeting is the first line a visitor sees. Keep it short, say who they are talking to, and invite the question they came with: "Hi, this is the front desk. Ask us anything about scheduling or pricing, and we can book you in right here." If an AI answers first, say so in that first message.
Then write saved replies for the questions you get most: hours, service area, how pricing works and how soon you can come. Staff send them in one click, and an AI agent answers from the same list, so every visitor hears the same thing.
For greeting and reply wording you can copy, see our live chat examples, and for the answers an automated chat should give on its own, see chatbot responses for common questions.
Route chats to a person or an AI that books
Routing decides who sees each conversation. Set it before launch.
- One shared inbox. Small teams send every chat to one place and whoever is free takes it. Larger teams split by service or location.
- Alerts that reach someone. Turn on phone notifications for whoever is on duty.
- AI first, person on handoff. An AI agent answers right away, collects details and books simple visits, then hands complaints, custom quotes, emergencies and anyone who asks for a person to your team.
- The same customer record. Save the visitor's name and number with the chat, so their next call or text shows the history.
For how a chat connects to a calendar, read website chat booking.
Call our AI at +1 (423) 574-4514. Ask it anything a customer would.
What a working chat looks like
Here is one conversation for a roofing company on a weekday evening, after the chat was installed, the hours set and the AI told which jobs it may book.
AgentHi, I am the virtual assistant for the roofing company. Our office is closed for the night, but I can answer questions and book an inspection now.
VisitorCan someone look at my roof this week? A few shingles came off in the wind.
AgentSorry to hear that. Is any water coming inside right now?
VisitorNo, just the shingles in the yard.
AgentThanks. I have Thursday at 9 or Friday at 1 for an inspection. Which works better?
VisitorThursday. How much will the repair be?
AgentThursday at 9 is booked. Repair prices depend on what the inspector finds, so the estimate comes after the visit. What name and mobile number should the confirmation go to?
VisitorDana, 423 555 0142.
AgentDone, Dana. Your confirmation is on its way, and our office manager will see this chat when we open at 8.
The chat checked for an emergency first, booked from the real calendar and left the price for the estimate, as the company's rules said.
Test the chat, and fix it if it does not show
Spend twenty minutes trying to break it before customers do.
- Send a chat from a phone and from a computer, inside your hours and outside them, and confirm each one reaches the right person.
- Check that the chat button does not cover your call button, menu or a booking form on a small screen, and that the window opens and closes with the keyboard alone.
- Ask your most common questions, one awkward one, and ask for a person.
- Update your privacy page to say the site uses a chat tool and what it collects, such as names, numbers and messages.
If the button does not appear, the usual causes are a site that is not published yet, a plan that does not include custom code, part of the snippet missing, an old cached copy (try a private window), or code limited to some pages instead of all of them.
Having the chat set up and run for you
Pasting the code takes minutes. Writing the answers, keeping the hours honest, connecting the calendar and reading conversations every week is what makes a chat pay off.
That is what Sales Secret does in a managed setup. Our live webchat comes with your branding and business hours and AI responses built in. Our AI chat and text agents answer your website chat, texts, Facebook, Instagram and WhatsApp day and night from your prices and calendar, book in the conversation and hand your team anything that needs a person, all in one inbox with one thread per customer. See Live Webchat in what we build.
To hear the same kind of agent answer and hand off, call our line at +1 (423) 574-4514 and ask for a person whenever you like.
Frequently asked questions
How do I add live chat to my website?
Choose a chat tool, copy the code snippet it gives you, paste it once into your site-wide code area (usually before the closing body tag), publish the site and send a test chat from your phone.
Do I need to know how to code to add live chat?
No. You copy and paste a snippet into a settings box, or install the chat tool's plugin or app if it has one for your platform.
Where does the live chat code go on Wix?
In your dashboard, open Settings, then Custom Code under Development and integrations, click Add Custom Code, paste the snippet, choose the pages and the placement, and apply. The site must be published with a connected domain.
How do I add live chat on Squarespace?
Paste the snippet into the Footer field of the Code Injection panel, which places it before the closing body tag on every page. Code injection is included in the Core, Plus and Advanced plans and some legacy plans.
How do I add live chat to a WordPress.com site?
On a Personal, Premium, Business or Commerce plan, install the free WPCode Insert Headers and Footers plugin, open Code Snippets, Header and Footer, paste the code and save.
Why is my chat widget not showing?
Usually the site is not published, the plan does not allow custom code, part of the snippet is missing, or an old version is cached.
What should happen to chats after hours?
Show a clear message with when you will reply, or let an AI agent answer from your approved information and book, passing anything else to your team in the morning.
Can a website chat book appointments?
Yes, when it is connected to your calendar. It can offer real openings, collect the name and number and confirm the visit inside the conversation.