Triggering the Chat Window from a Custom Button

Guide users directly to your ChatBot by integrating custom triggers, such as buttons and links

If you’d like to open the Yonder ChatBot window from a button or link on your website, you can easily do this using the onclick HTML tag.

By applying onclick="toggleYonderChat()" to an element, you can trigger the chat window whenever a user interacts with it.


Implementation Examples

Using a Button

To add a button that opens the chat window, use the following code:

<button onclick="toggleYonderChat()">Chat with us</button>

Using a Link (<a> element)

If you prefer a text link instead of a button, use:

<a onclick="toggleYonderChat()">Chat with us</a>

Frequently Asked Questions

What if toggleYonderChat() doesn’t work?

Ensure that the Yonder ChatBot script is correctly installed and that there are no JavaScript errors in your console. Learn how to install the ChatBot code in Installing the Chat Widget on Your Website.


Have further questions? Contact support@yonderhq.com