Using a text link or button

To open the Chat Widget

By John D'Ambra

Last Update 6 天前

As an alternative to using the standard embed or inline chatbox, you can call a chat window from any text or button on your website.

You can do this in four steps:

1. Add the widget code to your site just before the closing </body> tag.

2. Add custom text or an image to your server with the click event.

3. Modify the widget behavior, so that it "Hides widget on load" (optional).

4. Display a custom image or text based on your status (optional).

Follow these step-by-step instructions:


Step 1 - Copy the Widget code


NOTE: If you've already installed the tawk.to plugin and widget on your site, you can skip this step and start with Step 2.


1. Log in to the Dashboard.

2. Go to the Admin section at the bottom of the left-hand sidebar.

3. Choose the site from the Properties menu (if you have more than 1 site).

4. Select the Chat Widget option in the menu.

5. Hover the cursor to the Widget Code section. Select Copy to Clipboard to copy the code.


5. Paste the widget code into your website HTML just before </body>

6. Refresh your website to ensure you see the widget.


Step 2 - Create a button or text on your site

Create a button or text and add the following code before it:

For a text link use:

For an image use:


Step 3 - Hide widget on load and pop out

1. Log in to the Dashboard.

2. Go to the Admin section at the bottom of the left-hand sidebar.

3. Select the Property from the dropdown menu (if you have more than one site).

4. Click the Chat Widget option.

5. Look for the Widget Behaviour - Visibility Settings.

5. Switch on Hide Widget On Load to hide the widget before it is clicked.


Step 4 - Display a custom image or text based on your status

If you followed Steps 1 through 3, you should now have an image or text on your site that pops out the chat when clicked.

An advanced option is to show different images based on the status of your widget. E.g., show one image when your widget is offline and show another when your widget is online.


1. Add the div code below into your website's HTML in the position where you would like the button or text to display. You do not need to add anything inside the div — just copy and paste it exactly as is.

2. Add and modify this code with your custom images and text and place it just before the </body> tag.

Click Here for a working example of text-based status code.


Was this article helpful?

26 out of 38 liked this article

Still need help? Message Us