Hidden Fields v3 (Get parameters from url and use it as variables)

Get parameters from url and use it as variables

Now you can send variables through the URL (params) to the bot. If you need your user's email, you don't need to ask for it again! Let's learn how to configure these hidden fields in a minute!

Hidden Fields functionality only works with lower case. If the parameter in the URL has Capital Letters, it won't be recognised
  1. First, in the builder select the Chatbot Settings (wheel) on the right menu and select Hidden fields:

  1. Now, add the fields you want to send using the URL by typing their name and pressing enter. Keep in mind that you need to use the same field names as in the URL so Landbot can match them:

  1. Add the variables to your URL. For example, if you want to use "email" and "name" as hidden fields, you need to add this:

    ?name=john&email=john@gmail.com

    And your landbot's URL should look like this:

    https://landbot.io/u/H-44687-K4QC4P5YEH0KALZ/index.html?name=john&email=john@gmail.com

You can display these fields in the flow to hyper-personalize the experience, or keep them in the shadow to nurture your users' information. 

 If you're using apps like MailChimp or Intercom, you can add dynamic fields to a URL so you can bulk send personalized URLs. 
Please bear in mind the system to accept the numbers 0 and 1 on it's own, they need to be passed as decimals:

?people=1.0&events=10&fines=0.0

Passing javascript variables from the Container Site to the bot

If you have javascript variables in the global scope in the container site, ready before the bot is loaded. You can pass variables too, by adding them as a parameters in the index url of the embedding script, and using Hidden Fields to use them in the bot too.

<script src="https://static.landbot.io/landbot-widget/landbot-widget-1.0.0.js"></script>
<script>
var myLandbot = new LandbotLivechat({
index: 'https://landbot.io/u/XXXX/index.html?name='+containerNameVariable+'&email='+containerEmailVariable,
});
</script>


How did we do?