Code

For Landbot (Web)

Learn how to use our block type Code, it lets you to easily add JavaScript code within a block and trigger Easter eggs!

Sometimes we want to trigger some Javascript functions during the flow, here is where we can do it.

The code in this blocks will be active only when the visitor passes through this point. So functions in the block don't have a global scope:

How to use the Code block

This code will be embedded inside <script> </script> tags, so there is no need to add them, as you can see below. In this example, when the visitor passes through this block, a "hello world" will be printed in the console

Code block and Add JS (Custom scripts) [Design/Advanced section]

Code in the Add JS section, are global, as soon as the footer of the bot is loaded in the web, it is ready to use. This is the place to set up, "global" functions and variables with global scope.

Even if they are placed in different sections, code can communicate easily as you can see below. Using the Code blocks to trigger the global

A Google Sheet integration block cannot be located after a Code block

For WhatsApp

For a list of all the blocks and current functionalities with WhatsApp bots, please check here

This block/functionality is not compatible with WhatsApp

For Facebook Messenger

This block/functionality is not compatible with Messenger


How did we do?


Powered by HelpDocs

Powered by HelpDocs