Swaru

Help

Putting the chat on your site

Allow your websites, then add one line to your pages.

Allow your websites

  1. On the Chat page, an admin lists your websites under Websites allowed to embed, one per line, such as https://www.example.com.
  2. Press Save.

Write each website as an origin: https://, the host name, and nothing after it. https://example.com and https://www.example.com are different origins, so list both if your site answers on both. Plain http:// is accepted only for localhost and 127.0.0.1, for testing.

Your plan sets how many websites you can list: 1 on Starter, 3 on Growth, 10 on Scale. Put it on your site shows the websites allowed and your plan's number. After a move to a smaller plan, only the first ones in your list, up to the new plan's number, keep the chat.

Add the line

  1. On the Chat page, copy the line under Put it on your site.
  2. Paste it into every page where you want the chat, for example in your site's shared footer or page template.
  3. Open a page of your site. A round chat button in the bottom-right corner opens the chat. Its name for screen readers, also shown when you point at it, is your own Launcher label, or "Open support" without one. Ask it a question to check it works.

Home counts this step as done once the first question arrives.

Opening the chat from your own button

The line adds its own button. To use yours as well, or instead:

  • Give any link or button the attribute data-sw-open. Clicking it opens the chat.
  • Or call window.SupportWidget.open() from your own script, and window.SupportWidget.close() to close it.
  • To hide the chat's own button, set window.SupportWidget = {launcher: false}; in a script before the line. If you also tell the chat who is signed in (Signed-in visitors), put both in the same object.

Where you cannot add a line to your pages, link to your chat instead: a page of its own on our site, with nothing on it but your chat. It suits an app's Help button, an email signature, or a website plan that does not allow code.

  1. On the Chat page, under Chat link, an admin presses Turn on the chat link.
  2. Copy the link it shows and use it wherever you like.

The link needs no website in your list. Questions asked there count like any others. Visitors there are always anonymous: to recognise your signed-in customers, use the line on your own pages (Signed-in visitors). An admin can turn the link off again, and it stops working at once.

Analytics

If your page has Google Analytics 4 (gtag) or PostHog, the chat sends them events such as help_open, help_ask, help_answer and help_handoff. They never carry the question, the answer or an email address. The same events are also sent on the page as a supportwidget:event event, for any other tool.

If the chat doesn't appear

See Troubleshooting.

Still stuck? Write to hello@getswaru.com.