Website

Installing the widget on your website

Put the chat on every page of your website: copy a code from the console, paste it into the header and check that the widget appears.

View as Markdown

The widget is the chat on your website: a round button in a bottom corner of the page that opens the chat window when clicked. Your chat agent answers, with the instructions and knowledge you gave it. Conversations reach the console, in Conversations, together with those from your other channels.

The agent's Share tab offers three codes: the widget, in the Chat button panel, the link and the iframe. The link and the iframe are covered in Full page and iframe.

The Share tab of the Agent profile with the Link and Direct Sharing, iFrame and Chat button panels; the Copy button of the Chat button panel is highlighted.
Copy the Chat button code and paste it into the website's head tag.

Before you start

  • A chat agent with the Active status, and access to the website's admin panel or files, or a web agency you can send the code to.
Video: Put the chat on your website AC-10The chat button code, WordPress and Shopify, the publishing domain, the check.

#Copy the code

  1. Open the Share tab

    In the console, go to Chat agentAgent profileShare.

  2. Copy the widget code

    In the Chat button panel, press Copy. The message “Copied to clipboard!” appears.

The code you copy looks like this:

HTML · the widget code (sample agent code)

<script defer id="supportfast-script" src="https://cdn.supportfast.ai/chatbot.js" data-chatbot-id="bot-a1b2c3d4e5"></script>

#Paste the code into your website

The code goes in the website's header, that is inside the <head> tag, right before </head>. Put it in the template shared by all pages, usually the theme header: this way the widget appears on the whole website.

  • As it is. Always copy it from the console and paste it without changes, in Google Tag Manager too: if it changes, the widget doesn't appear.
  • Once per page. A second code on the same page is ignored, even if it belongs to another agent. Different agents go on different pages.
  • At the bottom of the page too. If your platform doesn't let you write in the header, the code also works right before </body>.

Choose the guide for your platform:

#The publishing domain

The publishing domain sets which website the widget can appear on; it doesn't restrict the link and the iframe. It's optional: if you leave it empty, the widget appears on any website that uses your code.

We recommend filling it in once the website is online. This way the widget doesn't appear on websites that aren't yours, even if someone copies the code.

  1. Open the general settings

    Go to Chat agentAgent profileGeneral, Agent Profile panel.

  2. Type the domain

    In the Publishing Domain (Optional) field, type only the domain, all lowercase, without https:// and without www.: for example esempio.it. With a capital letter, as in Esempio.it, the widget doesn't appear on any page.

  3. Save

    Press Save changes in the bar at the bottom of the page. The message “Settings saved” appears.

With the domain esempio.it filled in, the widget behaves like this:

Page addressDoes the widget appear?
esempio.it and www.esempio.itYes.
negozio.esempio.itNo: a subdomain counts as a different website.
Another domain or a test addressNo.

Is your website on several domains or subdomains? Leave the field empty, or use one agent per website, each with its own domain.

Result

The widget appears on your website's pages, bottom right or bottom left depending on the Button position chosen in Interface. When clicked, it opens the chat with your agent.

#How to check

  1. Open the website in a private window

    Private browsing shows you the website as a new visitor sees it. If the website uses a cache, clear it first.

  2. Look for the widget

    Check the home page and a couple of inner pages.

  3. Ask a question

    Open the chat and type a message: the agent must answer.

  4. Check the console

    Open Chat agentConversations: the test conversation appears among those of the Web channel.

Test the agent before putting it online. With Test Chat, at the top of the agent's page, you talk to the same widget without touching the website: see Testing and publishing.

WidgetLink and iframe
Where it appearsOn every page of the website, above the contentIn a tab of its own or in a box on the page
Welcome bubble and closing XYesNo
Website page passed to the agentYes: the page's address and titleNo

In Conversations, chats from all three methods are in the Web channel.

A widget and an iframe on the same page make two chats. The visitor would see two separate conversations. Ask whoever looks after the website to hide the widget on the page with the iframe, using the CSS rule explained in Widget JavaScript API.

#Common problems

If the widget doesn't appear, appears only when you scroll the page or covers other elements, the causes and fixes are in Website widget.

#Frequently asked questions

If I change the agent's colors or texts, do I have to reinstall the code?

No: the code stays the same, and the changes you save in the console show up on the next visit.

#See also