Skip to content

Chat Widget Setup Guide using a Script Tag ​

This guide will walk you through the steps to set up a chat widget on your website using a script tag provided by Pleased2. The script tag allows you to easily integrate the chatbot and provide a seamless user experience for your website visitors.

Prerequisites ​

  1. Access to Your Website's Source Code: You'll need access to the HTML source code of the website where you want to integrate the chat widget.

  2. Pleased Account: Ensure that you have a Pleased account and have obtained your unique data-pls-client-id.

Step-by-Step Setup ​

Follow these steps to integrate the Pleased2 chat widget using a script tag:

Step 1: Obtain Your Pleased2 Client ID ​

Get your unique data-pls-client-id. This is the domain of your Pleased instance, for example mycompanyname.pleased.com.

Step 2: Create a Chat Widget ​

Go to Settings / Channels / Chat Widget Setup and create a widget. Associate it with a brand.

Step 3: Add the Script Tag to Your Website ​

After completing Step 2, you will have a code snippet. Add it to the HTML of your website, preferably before your site's JavaScript runs. An example snippet is shown below:

Replace YOUR_CLIENT_ID and YOUR_WIDGET_ID with the values from the widget setup page. New widgets use a UUID for data-pls-widget-id; existing numeric widget IDs remain supported.

html
<script
  src="https://cdn.pleased.com/widget/pl-loader.min.js"
  data-pls-client-id="YOUR_CLIENT_ID"
  data-pls-widget-id="YOUR_WIDGET_ID"
></script>

Step 4: Save and Publish ​

Save your changes to the website's HTML and publish the updated website to make the chat widget live.

Step 5: Testing ​

Visit your website and the chat widget should now appear, allowing visitors to engage with your chatbot. Your chatbot status should also update in Settings / Channels / Chat Widget Setup.

Note: The application/website must be served by a web server. Opening the HTML file directly from the filesystem (file://) is not supported because the integration requires communication via postMessage.