Workarounds & Codes

Refillable bottles

In some cases we want our bot to communicate with our website, and we can style its elements so for that reason we thought it is a good idea to show you how to fill some bottles depending on the user…

Luis Trueba
Updated 4 weeks ago by Luis Trueba

Proactive message on mobile

Having troubles viewing your amazing Proactive Message on your phone? Let's get that fixed! Showing correctly the Proactive message essentially depends on the width of the device being used; in order…

Pau Sanchez
Updated 7 months ago by Pau Sanchez

Different ways to format numbers with JS

In Landbot 3 Transform 1000 to 1,000 First, we ask for a number and store it in the @number variable. With a Code block we add the function that will transform the number: function fixValue(value){ r…

Pau Sanchez
Updated 1 year ago by Pau Sanchez

Conditional Welcome: Direct the Flow of Your Bot Based on External Parameters

There are several instances where we may need a dynamic bot with different flow options. In this example, we'll create two different flows for our user, depending on an external parameter, in this ca…

Abby
Updated 2 months ago by Abby

Prevent Landbot from loading in mobile browsers

Due to design or speed, we might want to avoid Landbot being displayed and loaded in Mobile devices, here is a sample code to do that: <script> document.addEventListener('DOMContentLoaded', function(…

Pau Sanchez
Updated 2 months ago by Pau Sanchez

How to not display Proactive Message to repeating Visitors

Here is the code you need to use in the page where you added the code to display the bot, to stop displaying the Proactive message to repeating visitors Landbot 3 In the Design > Custom Code > Add JS…

Pau Sanchez
Updated 2 months ago by Pau Sanchez

Display Bot During Business Hours Only (Livechat & Popup)

In the case that we only want to display the bot during business hours, we'll simply add a snippet to the Javascript of the bot (only Livechat & Popup). In this workaround we'll use the Javascript me…

Abby
Updated 3 weeks ago by Abby

Random 4 digits Number (Web)

Generate a 4 digits random number to be used in a variable to verify a phone number. Send this number to a third party app and validate your users by checking if their input matches or not, therefore…

Pau Sanchez
Updated 5 months ago by Pau Sanchez

Cookie consent banner (full page / full page embed)

Due to legal reasons we might need to add a legal consent banner, and ask the user for consent. Below is a handy sample code in case you want to add such functionality specially designed for Full Pag…

Pau Sanchez
Updated 4 months ago by Pau Sanchez

Set the flow depending on the url path (for embedded landbots)

Only for landbots embedded (not standalone). Do not test in Preview mode. We might want to personalise the experience of the visitor to our site with different "chatbots" depending on the section tha…

Pau Sanchez
Updated 1 year ago by Pau Sanchez

Trigger a Global Keyword with JS (web v3)

Global Keywords allows you to set paths, based on a specific Keyword. Thanks to Landbot SDK we can trigger a Message via Javascript, that can trigger the sending of a message, that will trigger the g…

Pau Sanchez
Updated 10 months ago by Pau Sanchez

Create a Scale out of Buttons - Workaround

Sometimes we may want custom numbers in our scales, as this isn't currently an option in the scale block, you can use buttons with CSS to achieve the appearance of a scale. The builder: The CSS: /*Bu…

Abby
Updated 3 months ago by Abby

How to pass WordPress logged in user data to Landbot

Being able to identify logged in users can be very important for some businesses and websites. We can achieve that by passing the lead's information in an identity in the embed code. We are using Wor…

Abby
Updated 2 months ago by Abby

Generate a URL that has variables from user answers

It can happen that at the end of the flow you want redirect your clients to a specific website. It can be also the case that you want to generate a URL with the values provided by the users and that…

Pau Sanchez
Updated 2 years ago by Pau Sanchez

Resume flow based on external process with Landbot API (Request, Set, Go)

There are flows, that need an external process to be done to resume before the user can proceed. And at the same time, that process might be conditioned. For example a payment processed that is being…

Pau Sanchez
Updated 2 months ago by Pau Sanchez

Popup on Exit Intent

When trying to capture leads we need to use every resource available, here we'll show you how to display a popup modal when the user scrolls out of the page using the open-source Ouibounce library. T…

Abby
Updated 4 weeks ago by Abby

Contact