Before you begin
- You must know how to use variables in the builder.
- You have to create variables in the builder for the data you want to pass to the chatbot. If the variables already exist, you can skip this step.
Pass custom data during launch
When you install the chatbot on your website, you get a code snippet similar to this:variables
property to the chtlConfig
object, and listing the variable names and their values.
Example
Let’s say you want to pass the user’s name, email and age to the chatbot. First, you need to create variables for them in the builder.

Pass custom data after launch
If at any point after launching the chatbot, you want to pass some data to it, you can do so by calling thewindow.Chatling.setVariables
function.
- The
setVariables
function must be called after the chatbot widget has loaded.
- Variables must be present in the builder and the names must match exactly.
- This will overwrite any existing values for the variables.