Install the messenger on your website
Paste one snippet and visitors can chat with your team from any page.
The messenger is the chat bubble in the corner of your website. Installing it takes one snippet, and it works on any site: plain HTML, a site builder, or an app built with React, Next.js, Vue or anything else.
1. Copy your snippet
Go to Settings → Messenger. Your snippet already includes your workspace's key:
<script>
window.intercomSettings = { app_id: "YOUR_WIDGET_KEY" };
(function () { var i = function () { i.c(arguments); }; i.q = []; i.c = function (a) { i.q.push(a); }; window.Intercom = i; })();
</script>
<script async src="https://app.ongoing.ai/widget/widget.js"></script>
2. Paste it on every page
Add it just before the closing </body> tag, in your site's shared layout or template so it's on every page. In Next.js, add it to your root layout with next/script:
import Script from "next/script";
// app/layout.tsx, inside <body>
<Script id="ongoingai-settings" strategy="afterInteractive">
{`window.intercomSettings = { app_id: "YOUR_WIDGET_KEY" };
(function () { var i = function () { i.c(arguments); }; i.q = []; i.c = function (a) { i.q.push(a); }; window.Intercom = i; })();`}
</Script>
<Script src="https://app.ongoing.ai/widget/widget.js" strategy="afterInteractive" />
3. Check it works
- Reload your site. The chat bubble appears in the bottom-right corner.
- Open it, choose Send us a message, and send a test.
- The conversation appears in your inbox under Unassigned.
Coming from Intercom?
The messenger understands Intercom's snippet and commands, so Intercom('show'), Intercom('hide'), Intercom('showNewMessage', 'Hi!') and Intercom('shutdown') keep working. Swap the script tag and the key, and your existing buttons and links still open the messenger.
If it doesn't appear
- Content Security Policy: if your site sends a CSP header, allow
https://app.ongoing.aiinscript-src,img-srcandconnect-src, pluswss://app.ongoing.aiinconnect-src. - Order: keep the settings script before
widget.js, and include both once, in your layout. - Still nothing? Look in your browser's console for messages starting with
[ongoingai].
Related articles
Still have questions?
Ask us in the chat and someone on the team will get back to you.