How to open the live chat with a pre-populated message?

If you want to populate the live chat on your side with a pre-defined message this is thee right tutorial

Luca Micheli
Written by Luca MicheliLast update 2 years ago

Have you ever wanted to let your users open a live chat with your team with a pre-populated message?

Use cases may vary and it's a great addition to your customer experience. 

Let's say you want a customer to reach you out when they click on a button to upgrade to an Enterprise plan, you can do this and add a pre-populated message such as: "Hey team, I need to speak to the Sales team for an Enterprise plan".

The JS API code to use to open your live chat with a pre-defined message is the following

customerly.showNewMessage('Hey team, I need an Enterprise plan for my project, can you help?');

So if you want to add to your button the opening of the live chat with a pre-defined message this is the code you might want to use

<button onclick="customerly.showNewMessage('Hey team, I need an Enterprise plan for my project, can you help?')">Upgrade to Enterprise</a>


If you want to understand how to interact more with the live chat API follow this tutorial here.

If you want to let them open a chat directly without even pressing enter, you can use the sendNewMessage function.

customerly.sendNewMessage('Hey team, I need an Enterprise plan for my project, can you help?');

Use this in cooperation with anonymous chats and you will have a higher interaction rate with your CTAs.

If you want to see this in action click on the 🙁 below.


Cool isn't it?

Did this answer your question?