If your site already runs Google Tag Manager, you can add the widget from Tag Manager. You do not need a developer or a new release of your site.

Before you start

  • Your website widget. Kelu makes one for you when you create a knowledge base. Find it under Integrations → Website widget. You need the widget id and public key from the code on its Install tab.
  • Your site’s address on the widget’s Sites it works on list (Install tab).
  • Google Tag Manager on every page of your site.
  • Publish access to your Tag Manager container.

Add the widget

The widget’s Install tab shows these same steps with your code already filled in.
1

Create a Custom HTML tag

In Tag Manager, open your container. Click Tags, then New. Click Tag Configuration and choose Custom HTML.
2

Paste the loader into the HTML box

The loader adds the widget’s script tag itself, so the widget id and key always reach the widget:
<script>
  (function () {
    if (document.getElementById("kelu-widget")) return;
    var s = document.createElement("script");
    s.id = "kelu-widget";
    s.async = true;
    s.src = "https://widget.kelu.dev/kelu-widget.js";
    s.setAttribute("data-widget-id", "YOUR_WIDGET_ID");
    s.setAttribute("data-client-key", "kl_pk_...");
    document.head.appendChild(s);
  })();
</script>
Replace YOUR_WIDGET_ID and kl_pk_... with the values from your widget’s Install tab.Under the HTML box, tick Support document.write.
3

Fire it on all pages

Click Triggering and choose All Pages. Give the tag a name, such as Kelu Ask AI, and click Save.
4

Publish

Click Submit at the top right. Choose Publish and Create Version, then click Publish.
To test before you publish, click Preview, enter your site’s address and click Connect.

Check it works

Open any page of your site. A round icon button appears in the bottom-right corner, with the tooltip Ask AI. Ask a question and check that the answer lists its Sources. Nothing there? See Troubleshooting.
If your site’s own search opens with Cmd+K, turn off Open with Cmd/Ctrl+K on the widget’s Search & opening tab so only one opens.