Skip to content
jibuni

Guides · 4 minute read

How to add the Jibuni chat box to your website

One line of code, and where to paste it on WordPress, Shopify, Wix or a site you built yourself.

Jibuni's chat box is one line of code. It does not change your website's design, it does not need a plugin, and it does not slow your pages down — the browser loads it after your own content, not before.

Before you start

Two things, in this order. Teach Jibuni something first, or the chat box will have nothing to answer from and will tell every visitor it does not know — see how to teach Jibuni about your business. Then come back here.

You also need somebody at Jibuni to have checked your business. We do that by hand, usually the same day you sign up. Until then the switch to go live stays locked, which is deliberate: anybody can type any business name into a sign-up form, and a chat box speaking for a SACCO that is not theirs would be somebody else's fraud.

Find your line of code

  1. Open your Jibuni dashboard and go to Chat box.
  2. Try it yourself in the preview on that page. Ask it the three questions your customers ask most.
  3. When you are happy with it, switch Live on.
  4. Copy the line of code. It looks like this, with your own business's code in the middle:
<script src="https://jibuni.co.ke/widget.js" data-jibuni="YOUR-CODE" async></script>

Paste it just before the closing </head> tag, on every page you want the chat box to appear on. Usually that means pasting it once into your theme's header, which puts it on the whole site.

WordPress

The simplest way, with no plugin and nothing to break:

  1. In your WordPress admin, go to Appearance → Theme File Editor.
  2. Open header.php in the list on the right.
  3. Find </head> and paste the line immediately above it.
  4. Click Update File, then open your website in a new tab.

If your theme updates itself, that edit can be overwritten. To avoid that, either use a child theme, or install a small plugin such as one of the "insert header and footer code" plugins and paste the line into its header box instead. Both are fine; the plugin is easier to undo.

Shopify

  1. From your Shopify admin, go to Online Store → Themes.
  2. On your current theme, click ⋯ → Edit code.
  3. Under Layout, open theme.liquid.
  4. Find </head> and paste the line immediately above it.
  5. Click Save.

Wix

  1. In your Wix dashboard, go to Settings → Custom Code.
  2. Click Add Custom Code.
  3. Paste the line into the code box.
  4. Set Add Code to Pages to All pages, and Place Code in to Head.
  5. Click Apply.

A website you or a developer built

Paste the line into your HTML template before </head>. That is all it needs — no build step, no package to install, no framework to configure. It is plain JavaScript with no dependencies, it lives inside a shadow root so it cannot touch your own styles and your styles cannot touch it, and it is about 10 KB over the wire.

If your site sends a Content Security Policy header, add https://jibuni.co.ke to your script-src and connect-src. The chat box is written not to need unsafe-inline for either styles or scripts.

Pinning a version

/widget.js always serves the current script, so a fix reaches your website the same day without anybody asking you. That is the right default for almost everybody.

If you would rather your site ran a script you have checked and nothing else — a reasonable position for a bank or a SACCO — every release is also kept at its own permanent address with a hash you can pin:

<script src="https://jibuni.co.ke/widget-<version>.js"
        integrity="sha384-..." crossorigin="anonymous"
        data-jibuni="YOUR-CODE" async></script>

The browser then refuses to run anything that is not byte for byte the file you pinned, including anything our server might later be made to send. The trade is that you stop getting fixes until you update the snippet yourself. Ask us for the current version and hash, or find them on the Chat box page.

Check it worked

Open your website in a private window — not the tab you were editing in, which may be showing you a cached page. You should see the bubble in the corner within a second or two. If you do not:

Still nothing? Send us the address of your website and we will look at it with you.

Next

How to teach Jibuni about your business

Point it at your website, upload your fee structure, or type the answers yourself — and what makes an answer it can actually use.

Ready to try it?

Jibuni is free while it is new. Making an account takes a minute, and nothing appears on your website until you switch it on yourself.