Webchat examples

Complete example pages for the webchat, from the minimal snippet to branding, context, embedded mode, events and handoff.

Example pages are complete web pages that show the webchat in use. Each card below is one page. Choose View and copy to read and copy its code, or Download to save the file. Then put it on a test page of your website.

To see the chat alongside a quote form, sharing one application, see the quote form's example 07.

Trying the example pages#

  1. Copy the page you want.
  2. Replace the placeholders. YOUR_AGENT_ID is your agent's id. In the dashboard, go to Agents and open the agent. The id is in the address bar, and in the snippet under Channels, Web, Configure. A comment above each placeholder says where to find it.
  3. Switch the Web channel on (same page, Enable). The example pages count as a website outside Subcontext, so without this the chat stays hidden.
  4. Put it on a test page of your website. The webchat has no allowed-websites list, so any address works. Opening the file from your computer won't work.

Tips:

  • Pages on the same website address share the saved conversation. Example 04 starts a new one each time. Elsewhere, type /new in the chat to start over.
  • Talking in the browser needs a microphone. It works on localhost without https://.
  • Example 06 sends real texts and emails. Use your own number and address. The text and WhatsApp choices need an SMS or WhatsApp channel with a number on the agent.

Stuck, or something missing?

Get in touch and a person on the team will help.

Contact us