Users and collection of information

As soon as the user writes to the bot, he automatically goes to the "Users" section:

This gives you an added edge if you're marketing or launching your own products.

The classic scheme for launching a product is as follows: you make a landing page, describe the product, insert an application form. What is the problem: when a user comes to this landing, he is impersonal. He can leave at any moment: when he looks at a photo, reads about you, fills out an order form.

Although this is usually tracked through systems like Google Analytics and Yandex.Metrica, the bot has a plus. Once a user has contacted a bot, you automatically get all of their contacts, which opens up new possibilities.

Let's go back to our script and expand it a bit by gathering more information from the user. We already know the last name, first name or nickname from Telegram, so let's ask the phone:

To pick up the user number, use the "Process message" block.

Note that you can also right-click anywhere in the script and create the desired block. This is the same as the menu on the left:

When the user writes something, the bot will process his response and save the data to the specified variable:

A variable is a key by which either some value is written for each user, or a common, global value for all users at once. For example, a global counter of customers who have submitted an application.

Now we need a phone. Therefore, I will create a variable with the same name and type "User" - it will be tied to a specific user. If we needed a common variable for all users at once, we would choose the "Global" type.

Now the bot will store the phone number. Let's add one more block to the script - so that the bot answers: "Thank you, we will call you back at %Phone%".

Script testing can be started from a specific step. To do this, hover over the blue button next to it and click "run":

We check the script, we see that everything works. The bot saved the variable and now we can use it:

Now in the "Users" section, you can add a new variable and see its value next to the user:

Last updated