SociaHive Docs

Chat widget

Add the SociaHive chat widget to your site, and open it from your own "Chat with us" button.

The chat widget lets visitors to your website chat with you, read your help articles and come back to past conversations. Their messages arrive in your SociaHive inbox.

Create and style a widget in the dashboard under Support → Chat widget. That is also where you copy its embed code.

Add it to your site

Paste the embed code just before the closing </body> tag of every page where the chat should appear. Put it once in your shared layout or footer, not page by page.

<script src="https://www.sociahive.com/widget/YOUR_WIDGET_ID.js" async></script>

A round chat bubble appears in the bottom corner. The dashboard has steps for WordPress, Shopify, Wix and other site builders, and a prompt you can paste into an AI coding tool.

Add a "Chat with us" button

To open the chat from your own button, for example on your support or contact page, add data-sociahive-open="chat" to any button or link:

<button type="button" data-sociahive-open="chat">Chat with us</button>

Clicking it opens the chat. If the visitor already has an open conversation, it opens that one; otherwise it starts a new one. The embed code above must be on the same page.

No script is needed, so it works in site builders that let you add an attribute to a button but not your own code. Buttons added to the page later (by a popup or a single-page app) work too.

Other places to open

ValueOpens
chatThe visitor's open conversation, or a new one
helpYour help articles (only when help is turned on for the widget)
messagesThe visitor's past conversations
homeThe start screen

Any other value opens the widget where the visitor left it.

On a link, keep a real href. If the widget cannot load (an ad blocker, a network problem), the link works as a normal link:

<a href="mailto:[email protected]" data-sociahive-open="chat">Chat with us</a>

Use only your own button

To hide the round chat bubble and open the chat only from your own buttons, put this line just before the embed code:

<script>window.SociaHiveWidgetSettings = { hideLauncher: true };</script>
<script src="https://www.sociahive.com/widget/YOUR_WIDGET_ID.js" async></script>

With the bubble hidden, make sure the page has a button that opens the chat. Otherwise visitors have no way to reach you.

Open it from JavaScript

The widget also has a small API on window.SociaHiveWidget, for when you open it from your own code:

window.SociaHiveWidget?.open('chat')   // or 'help', 'messages', 'home'; no value reopens where the visitor left it
window.SociaHiveWidget?.close()
window.SociaHiveWidget?.setLauncherHidden(true)   // hide or show the bubble at any time

window.SociaHiveWidget exists once the embed script has loaded. Calling open() before the widget has finished starting is fine: it opens as soon as it is ready.

On this page