Table of Contents

Hidden Fields (Get params / UTMs from url and use it as variables)

Pau Sanchez Updated by Pau Sanchez

๐Ÿ‘‰ Did you know that you can hyper-personalize the user experience of your bots with the Hidden Fields?

Do you want to capture utm from your campaigns?

For example, if you already have the user's name saved as a variable in a bot, you don't need to ask for it again!ย ๐Ÿค“

You can also "keep them in the shadow" to nurture your users' information.

If you want to learn more about Landbot's variables, you should read this article, then check the Set variable article!

Get params from url and use it as variables

Wondering what are the Hidden Fields? Let's start from the beginning!

A URL can be used to pass information with a click.

Any word after the question mark "?" in a URL is considered to be a parameter which can hold values.

The value for the corresponding parameter is given after the symbol "equals" (=).

Multiple parameters can be passed through the URL by separating them with "&".
Hidden Fields functionality only works with lower case. If the parameter in the URL has Capital Letters, it won't be recognised

With Landbot's Hidden Fields, you can send variables (parameters) through the URL of the bot.

Let's see how to configure them in 3 easy steps!

  1. First, go to the Builder and select the bot Settings, then selectย Hidden fields on the left menu:

  1. Now, add the variables you want to send using the URL by typing their name and pressing enter, then click on Apply Changes.
    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

ย 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 that for the system to accept the numbers 0 and 1, they need to be passed as decimals, like 1.0 or 0.0

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

Restricted keywords

These are keywords you are not allowed to use as a hidden fields (parameters) in the url:

  • location
  • welcome
  • message

The use of these words might generate an error like below:

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>

Wordpress has restricted words, like "name", please check the full list here: https://codex.wordpress.org/Reserved_Terms

If used it will generate a 404 error

Examples of how Hidden Fields (params) are built in other platforms

1. FOR PERSONALISATION PURPOSES: Create Unique URLs for email campaigns with Mailchimp

Here is an article of how Merge Tags, are use to personalize emails to Mailchimp subscribers, this is a very common case. Thanks to Hidden Fields, you can capture the values from the merge tags and use it in your bot: https://mailchimp.com/en/help/create-unique-urls-for-subscribers/

2. FOR TRACKING PURPOSES: UTM Code

Other very common use of Hidden Fields would be to capture UTMs for tracking. Here is a little guide about UTMs, that later you can capture with Hidden Fields: https://buffer.com/library/utm-guide/

How did we do?

Second Visit Settings

Landbot native SEO & Tracking tools

Contact