Skip to content

Install the chat on your website

Copy your agent's embed code, paste it before </body> on every page of your site, and check that the chat has loaded.

4 min readاقرأ المقال بالعربية

To show the chat window to your visitors, you add one line of code to your site: your agent's Embed code. You add it once. Whatever you change later in Appearance, Behavior or Knowledge reaches your site without touching the code.

Who can do this: members who can view agents see and copy the code. Changing Allowed sites needs permission to edit agents. You also need to be able to edit your site's code.

Before you install, test your agent to make sure it answers the way you want.

Step 1: Copy the embed code

  1. Open your agent, then Install.

  2. In the Embed code card, click Copy. The button changes to Copied.

The code is one line like this, with your agent's key in it:

<script src="https://zolai.io/widget.js" data-agent="…" async></script>

Always copy it from your agent's page rather than typing it.

The Install page with the Embed code and its Copy button, and the "On your site" card showing "Loaded on" and the site's domain
Tip:

The code is also at the top of every page of your agent: click Install to open Install on your site, with the code and a Copy button, without leaving the page you're on.

The "Install on your site" dialog, opened from the Install button at the top of the agent's page, with the embed code and the Copy button

Step 2: Paste it into your site

Paste the code before </body> on every page, or in the custom code box of WordPress or any platform that lets you add code to every page. Then save or publish your changes.

  • A site you code yourself: put it in the template every page shares (the footer, for example), before </body>.

  • WordPress: use a plugin that adds code to the footer of every page (steps below), or put it in your theme's footer file before </body>.

On WordPress, with a plugin:

  1. In your WordPress dashboard, go to Plugins → Add New.

  2. Search for "header footer code", then install and activate a plugin that adds code to every page.

  3. Open the plugin's settings and paste the embed code in the Footer box.

  4. Save, then open your site: the chat button appears in the corner.

If your site uses a caching plugin, clear its cache so visitors get the new page.

Info:

Some store platforms don't let you paste code into their pages; they only add scripts through an app from their app store. If your platform has no box for adding code to every page, the chat can't be installed there yet.

Step 3: Check that it loaded

  1. Open any page of your site and open the chat from its button once.

  2. Go back to Install in the dashboard.

  3. The On your site card shows Loaded on, your site's domain and when. Before that it says Not loaded on any site yet.

Check that the domain shown is your site's. Next to the agent's name at the top of the page, Installed replaces Not installed yet.

Info:

Try it on a test page also records Loaded on, with the Zolai domain. That is why you should check the domain shown is your own site, not Zolai's.

Allowed sites

At the bottom of the Install page are the Allowed sites: the domains the chat works on, subdomains included. If you built your agent from your website, its domain is already there.

  • If you install the code on another domain, add it here, or the chat won't work there. Type just the domain, like shop.com.

  • If the list is empty, the chat works on any site and the page warns you about it. Add your domain before launch, so nobody can use your agent on another site.

If the chat doesn't show

Check, in this order:

  1. The code is on the page, and your changes are published.

  2. Your site's domain is in Allowed sites.

  3. The Pages section in Appearance lets the chat show on that page.

  4. The agent isn't paused.

More detail: The chat doesn't show on my site.

Limits

What

Limit

Allowed sites

Up to 20 domains, subdomains included

Embed code

One line per agent