Table of Contents
Open / Close a Web bot (embedded)
This solution will allow you to automatically open the embedded bot on your website, whether it's a Livechat or Popup type, and also close the bot when clicking a button.
You have a template ready to download, here.
Open bot
This functionality is managed by the code located in the Design > Custom Code > Add JS section of the bot. It will automatically open the bot after the bot is loaded on the website.

<script>
let landbotScope = this;
landbotScope.onLoad(function(){
myLandbot.open();
})
</script>
Close bot
This functionality is handled by the code located in the Code Block of the bot. It will automatically close the bot after the user clicks on the "Go" button.

myLandbot.close()
If you are embedding your bot using the "Improve page loading speed and SEO performance" option enabled in the Share section of your bot, you will need to use the following code in your Code block instead:
this.close()
for Web
This feature is fully compatible.
for WhatsApp
This feature is not compatible with WhatsApp.
for Messenger
This feature is not compatible with Messenger.