How to launch a Landbot by clicking a button

Ana Updated by Ana

Here below you can find the code you need to trigger and open your landbot, embedded as a LiveChat or Pop up mode, by clicking a button.

<div id="wrapper">
<button class="openbot">Open Bot</button>

<script SameSite="None; Secure" src=""></script>
var myLandbotpop = new Landbot.Popup({
configUrl: ''

var buttonOpen = document.getElementsByClassName("openbot")[0];
buttonOpen.addEventListener('click', (event) => {

To hide the widget, you must add the code below in the Design > Custom Code > Add CSS section of your bot:

display: none

How did we do?

Load script and display bot on click button

Open LiveChat bot as soon as page loads (3 ways)