One line of code: how a chatbot is added to a website
BizzBot5 min read
A chatbot is added to a website by pasting one short line of code, called a script, into a place that loads on every page. That line calls up the chat window from an outside server and displays it in the corner of the site. It does not change how your site looks, and if you would rather not touch it, someone else can do it for you.
In short
- A script is a small program that the site loads and that displays the chat window.
- The widget is the chat window itself, usually an icon in the bottom corner.
- The code is pasted once, in a place that applies to the whole site.
- If that is inconvenient for you, someone else can paste the code for you.
What a widget and a script are
The widget is the visible part of the chat, and the script is the line of code that starts it. The widget is the icon in the bottom right corner that a visitor clicks to open a conversation. The script is an instruction the site reads when it opens: "load the chat window from this address". The visitor sees only the icon, and underneath it sits one line that connects everything.
For example, on bizzbot.rs you can see the demo agent Bizi as an icon in the bottom right corner. That is exactly a widget.
The script consists of the address the chat is loaded from and a few settings, and it looks like an unreadable string of characters. You do not need to understand it; it is enough to pass it along exactly as you received it. Think of it as a nail in a wall: it does not change the wall, but without it there is nowhere to hang a picture.
The script does not turn your site into something else. The site stays the same, and the chat is simply displayed over it. If you delete the script later, the widget disappears and everything else stays as it was.
Where the code goes
The code goes in a place that loads on all pages, most often the header or footer of the site. Most sites have a section for "extra code" or "scripts" in the theme or platform settings. The general rules are the same regardless of platform:
- Find the place for extra code. Look for names like "header", "footer", "custom code", "additional scripts" or "code injection".
- Choose a place that applies to the whole site. If you paste the code on only one page, the chat will show only on that page.
- Paste the line of code exactly as you received it. Do not change it, and do not add spaces or quotation marks.
- Save and refresh the site. Open the site in a new window and check that the icon appears.
- Check on a phone. Open the site on mobile too, because most visitors come from there.
For specific systems, see the articles on a chatbot on a WordPress site and on a chatbot on an online store.
What if you are not technical
Pasting code does not require programming, but if you are uncomfortable with it, you do not have to do it yourself. There are three usual routes.
- Yourself. If you have access to the site's admin area and can see a field for extra code, the line can be pasted in a few minutes.
- Whoever maintains your site. Pass them the code and the instructions; it is a few minutes of work for them.
- The chatbot provider. With BizzBot, you can paste the code yourself or we can paste it for you.
Before you change anything on your site, make a copy or check that your platform keeps previous versions. That is a good habit even without a chatbot.
What else you should know about the script
Here are a few things owners often ask that are not technical.
Does it slow down the site?
Every addition adds a little load, so it is wise to check speed before and after. The article on a chatbot's effect on SEO covers what is known and what is not.
Does it work on all pages?
It works wherever the code is loaded. If your site has several parts (for example, a main site and a separate store), check that the code is placed on each one.
What if I change my theme or platform?
Code placed in the theme can disappear when you change it. So keep a copy of the code and, after every major change to the site, check that the icon still appears.
Does anything need to be installed on a server?
Not for BizzBot; it is enough to paste one line of code. With other solutions the requirements may differ, so ask the provider.
Checking that everything is in order
Once you have pasted the code, do a short check.
- The icon is visible on the home page, on a product page and on the contact page.
- A click opens the window, and the window closes.
- The agent answers a simple question.
- On a phone, the icon does not cover important buttons, for example "Add to cart".
- The greeting and the agent's name are what you approved.
- The window opens quickly and does not block reading the site.
Before you show the agent to customers, also go through testing with real questions.
Frequently asked questions
Is one line of code enough for the chatbot to work?
For displaying the chat window, yes, but the agent must be set up beforehand. Knowledge about your offer, rules and tone of conversation is set up before the code goes live, otherwise the window will be empty or imprecise.
Can I remove the chatbot from my site?
Yes. It is enough to delete the line of code, and the icon disappears from all pages. Before deleting, save a copy if you plan to bring it back.
What if I do not know where to paste the code?
Send access or a screenshot of the admin area to whoever maintains your site, or ask the provider for help. With BizzBot, we can paste the code for you.
What next
If you are not sure whether your site has a field for extra code, open the settings and look for "header" or "custom code", and if you cannot find it, get in touch and we will check together. To see how the whole process looks from the start, read about BizzBot in three steps.