An AI chatbot on your website can answer questions at 2 AM, qualify leads while you sleep, and reduce your support ticket volume by half. Or it can annoy your visitors, give wrong answers, and make your brand look like it was built by someone who discovered automation last Tuesday. The difference is not the technology. It is how you set it up.
This guide covers the full process: why businesses add chatbots, what separates a good chatbot from a bad one, how to write a system prompt that actually works, what to put in the knowledge base, how to embed it on any website platform, and how to measure whether it is helping or hurting. It is written for business owners and marketing teams, not engineers.
1. Why Businesses Add Chatbots
The business case for a website chatbot is straightforward. Your website gets traffic around the clock, but your team works fixed hours. Every visitor who has a question and cannot get an answer is a potential customer who might leave and never come back.
The most common reasons businesses add chatbots:
- 24/7 availability — Chatbots do not take breaks, call in sick, or go on vacation. They answer the same question at 3 AM with the same accuracy as at 10 AM.
- Lead qualification — A chatbot can ask the right questions to determine whether a visitor is a good fit for your product before routing them to a salesperson. This saves your sales team from spending time on unqualified leads.
- Support deflection — Many support tickets are repeat questions with known answers. A chatbot that can handle the top 20 frequently asked questions reduces the load on your support team so they can focus on complex issues.
- Faster response time — Visitors expect instant answers. A chatbot responds in seconds. Even the fastest human support team takes minutes. That gap matters when the visitor is comparing your site to a competitor's.
- Data collection — Every chatbot conversation is data. You learn what your visitors are asking about, what confuses them, and what objections they have. This information is valuable for improving your website, your product, and your sales process.
2. What Makes a Good Chatbot
A good chatbot does not try to be a human. It tries to be useful. The best chatbots share several characteristics:
It Knows What It Knows
A good chatbot answers questions within its knowledge base accurately and confidently. Equally important, it recognizes when a question is outside its knowledge and says so honestly instead of making something up. The technical term for a chatbot inventing answers is "hallucination," and it is the single most damaging behavior a chatbot can exhibit. A visitor who gets a wrong answer and acts on it will not blame the chatbot. They will blame your company.
It Sounds Like Your Brand
A chatbot on a law firm's website should not use emojis. A chatbot on a surf shop's website should not sound like a legal brief. Your chatbot's tone, vocabulary, and personality should match your brand voice. If your brand is professional and understated, the chatbot should be professional and understated. If your brand is casual and friendly, the chatbot should be casual and friendly.
It Gets to the Point
Long-winded chatbot responses are a usability problem. Visitors are scanning, not reading novels. Good chatbot responses are concise: they answer the question, provide the essential context, and offer a clear next step. If the visitor needs more detail, they can ask a follow-up question.
It Knows When to Hand Off
Not every conversation should be handled by a chatbot. Complex sales discussions, sensitive support issues, and frustrated customers all need a human. A good chatbot recognizes these situations and hands the conversation to a person with the context of what has already been discussed.
3. How to Write a System Prompt
The system prompt is the set of instructions that defines your chatbot's behavior. It is the most important piece of configuration you will write, and most businesses get it wrong on the first try. That is fine. You will iterate.
What a System Prompt Should Include
- Role definition — Tell the chatbot who it is and what company it represents. "You are the customer support assistant for [Company Name]. You help visitors understand our products and answer questions about our services."
- Tone and personality — Define how the chatbot should communicate. "Respond in a professional, friendly tone. Use plain language. Avoid jargon unless the visitor uses it first."
- Knowledge boundaries — Tell the chatbot what topics it can and cannot discuss. "Only answer questions about [Company Name] products and services. If asked about competitors, say you can only speak to our own offerings. If asked about something you don't know, say so and offer to connect the visitor with our team."
- Response format — Specify how responses should be structured. "Keep responses under 3 sentences unless the visitor asks for more detail. Use bullet points for lists of features or options."
- Handoff rules — Define when the chatbot should escalate. "If the visitor asks to speak to a person, asks about pricing for enterprise plans, or expresses frustration, provide our contact email and phone number."
- Prohibited behaviors — List what the chatbot must never do. "Never make up information. Never provide legal, medical, or financial advice. Never share internal company information. Never promise discounts or special deals."
Common mistake: Writing a system prompt that is too vague. "Be helpful and friendly" is not a system prompt. It is a wish. Good system prompts are specific about what the chatbot should and should not do, with examples of ideal responses for common scenarios.
Example System Prompt Structure
Here is a template that works for most businesses. Replace the brackets with your specific information.
4. Building Your Knowledge Base
The system prompt defines behavior. The knowledge base defines what the chatbot actually knows. Without a knowledge base, your chatbot is working from the AI model's general training data, which means it might know about your industry but knows nothing specific about your business.
What to Include
- Product and service descriptions — Detailed descriptions of what you offer, including features, benefits, and use cases. Use the language your customers use, not your internal terminology.
- FAQ content — Every question your support team answers repeatedly. If you do not have a formal FAQ, ask your support team to list the top 20 questions they get. Those are your knowledge base foundation.
- Pricing information — What you are comfortable sharing publicly. If your pricing is on your website, include it. If pricing is custom, include the process for getting a quote.
- Company information — Your company story, team, location, hours, and any other background that visitors might ask about.
- Policies — Shipping, returns, refunds, warranties, cancellation, and any other policies that affect customer decisions.
- Technical documentation — If you sell a technical product, include setup guides, integration instructions, and troubleshooting steps.
- Competitor differentiators — Not to trash-talk competitors, but to help the chatbot explain what makes your solution different when visitors ask "how are you different from X?"
What Not to Include
- Internal processes, employee information, or financial data
- Information that changes frequently without a process to update the knowledge base
- Content that contradicts your website (the chatbot and website should say the same thing)
- Anything you would not want published on your website
Knowledge base maintenance: A knowledge base is not a one-time project. Every time you change your pricing, add a product, update a policy, or learn about a new common question, the knowledge base needs to be updated. Set a calendar reminder to review it monthly.
5. How to Embed on Any Website Platform
Most chatbot platforms provide an embed code: a small snippet of HTML and JavaScript that you paste into your website. The embed process varies by platform, but the mechanics are the same everywhere.
WordPress
For WordPress sites, you have two options. The simplest is to paste the embed code into your theme's footer. Go to Appearance > Theme Editor > footer.php and paste the code just before the closing </body> tag. If you are using a page builder like Elementor, add an HTML widget to your site's global footer template.
If you are not comfortable editing theme files, many chatbot providers offer WordPress plugins that handle the embed automatically. Install the plugin, enter your chatbot ID or API key, and the widget appears on every page.
Shopify
In Shopify, go to Online Store > Themes > Edit Code. Open the theme.liquid file and paste the embed code just before the closing </body> tag. Save and publish. The chatbot will appear on every page of your store.
Squarespace
Squarespace supports code injection under Settings > Advanced > Code Injection. Paste your chatbot embed code in the Footer section. This adds the code to every page without touching your theme templates.
Any HTML Website
For any static HTML site, open your main HTML file (usually index.html) and paste the embed code before the closing </body> tag. If your site has multiple pages, paste it in each page or use a shared footer file that all pages include.
Single-Page Applications (React, Vue, Angular)
For SPAs, add the embed script to your index.html file in the public directory. The chatbot will load once when the app initializes and persist across route changes. If you need to control when the chatbot appears (for example, only on certain pages), most providers offer JavaScript APIs to show and hide the widget programmatically.
6. Measuring Chatbot Performance
A chatbot that nobody uses is a waste of money. A chatbot that everybody uses but gives bad answers is worse. You need to measure both engagement and quality.
Engagement Metrics
- Conversation volume — How many conversations does the chatbot handle per day, week, and month? If the number is zero, you have a visibility or UX problem. If it is climbing, people are finding it useful.
- Messages per conversation — The average number of messages exchanged in a single conversation. Very short conversations (1-2 messages) might mean visitors are testing the chatbot and leaving. Longer conversations suggest engagement.
- Pages with highest engagement — Which pages drive the most chatbot conversations? This tells you where visitors have the most questions, which might also tell you where your website content is weakest.
Quality Metrics
- Resolution rate — What percentage of conversations end with the visitor's question answered, without needing human follow-up? This is the single most important quality metric.
- Handoff rate — What percentage of conversations get escalated to a human? Some handoffs are appropriate (complex sales questions), but a high handoff rate suggests the chatbot's knowledge base needs work.
- Satisfaction ratings — If your chatbot asks "Was this helpful?" at the end of conversations, track the positive response rate. Below 70% means the chatbot needs attention.
- Hallucination rate — Review a random sample of conversations weekly. How often does the chatbot provide incorrect information? Even a 5% hallucination rate is too high. Each wrong answer erodes trust.
Business Impact Metrics
- Leads captured — How many email addresses or phone numbers does the chatbot collect from qualified visitors?
- Support tickets deflected — Compare your support ticket volume before and after the chatbot launch. A well-configured chatbot should reduce ticket volume by 20-40% for common questions.
- Conversion influence — Do visitors who interact with the chatbot convert at a higher rate than those who do not? If yes, the chatbot is contributing to revenue. If no, it might be creating friction.
7. Common Mistakes and How to Avoid Them
Having deployed chatbots across dozens of businesses, certain mistakes appear repeatedly. Knowing them in advance saves you weeks of debugging.
Mistake 1: Launching Without Testing
Before your chatbot goes live, test it with 30-50 questions that your real customers ask. Do this yourself, not with a testing script. If any answer is wrong, misleading, or off-brand, fix the system prompt or knowledge base before launch. The first impression a chatbot makes is the one that sticks.
Mistake 2: Making It Too Aggressive
A chatbot that pops up immediately, blocks the content, and starts asking questions before the visitor has read a single word is the digital equivalent of a salesperson who follows you around the store. Set your chatbot to appear after a reasonable delay (15-30 seconds), or let it sit quietly in the corner until the visitor initiates. Proactive messages can work, but they should be relevant to the page the visitor is on, not generic "How can I help you?" prompts.
Mistake 3: No Escalation Path
If a visitor asks to speak to a person and the chatbot has no way to make that happen, you have created a dead end. Always include a clear path to human contact: an email address, a phone number, a calendar booking link, or a live chat handoff. The chatbot should present these options without the visitor having to ask twice.
Mistake 4: Set It and Forget It
Chatbots need maintenance. Your products change, your pricing changes, your policies change, and new common questions emerge. Review your chatbot's conversation logs at least monthly. Look for questions it cannot answer, answers that are outdated, and patterns that suggest knowledge base gaps. A chatbot that gives stale information is worse than no chatbot at all.
Mistake 5: Ignoring Mobile
More than half of website traffic comes from mobile devices. Test your chatbot on a phone. Is the widget too large? Does it cover critical content? Can visitors easily close it? Is the text readable without zooming? Mobile chatbot UX is a common afterthought that becomes a primary frustration.
Mistake 6: Too Much Personality, Not Enough Substance
Some businesses spend more time crafting their chatbot's witty persona than building its knowledge base. Visitors do not care if your chatbot tells jokes. They care if it can answer their question. Personality is a nice-to-have. Accuracy is a must-have.
8. Choosing the Right Approach
There are three broad approaches to adding a chatbot to your website, each with different tradeoffs.
Hosted Chatbot Platforms
Services that provide the AI, the widget, and the management dashboard. You configure the chatbot through their interface, upload your knowledge base, and embed their widget. This is the fastest path to a working chatbot and requires no technical skills. The tradeoff is less customization and ongoing subscription costs.
API-Based Custom Build
You build your own chatbot interface and connect it to an AI API. This gives you full control over the user experience, the conversation flow, and the data handling. The tradeoff is development time and the need for ongoing maintenance. This approach makes sense for businesses with engineering teams who want a tightly integrated experience.
Hybrid Approach
Use a platform for the core chatbot functionality but customize the widget's appearance and behavior to match your site. Many platforms offer enough customization through CSS and JavaScript hooks that the chatbot looks and feels native to your website while still being managed through the platform's dashboard.
Decision framework: If you need a chatbot working this week and do not have developers, use a hosted platform. If you have engineers and want the chatbot deeply integrated into your product, build custom. If you want something in between, look for platforms with strong customization options.
Build Your AI Chatbot with StellarClose
Our bot builder lets you configure your system prompt, upload your knowledge base, and get an embed code in minutes. No coding required.
Try the Bot Builder