Mini-App (MiniApps) Events
Handling Telegram bot events that occurred in a store-format mini-app
Creating a mini-app event handler
Information
Before creating an event handler, first create a new scenario that will be launched by this event.
To set up mini-app event tracking, go to the "Messenger and app events" section and open the "MiniApp" tab.
.png)
Mini App tab
Click "Create" and select the required event. For details on all events, see Mini App event list
.png)
Event selection
In the event creation form, fill in the name, select a scenario, and activate the event.
.png)
Event handler settings page
Mini-app event list
| Event name | Event description | Variables available in the scenario |
|---|---|---|
| Store launched via button | User launched the store via a button | - |
| Store launched via link | User launched the store via a link | - |
| Checkout page opened | User navigated to the checkout page |
|
| Order created (order placed) | User placed an order |
|
| Cart created | User added a product to an empty cart. |
|
| Order status changed | Order status changed (automatically or manually) |
|
Example contents of the miniapp_cart_json variable
[
{
"categories": ["Clothing", "T-shirts"],
"currency": "RUB",
"image": "https://storage.leadteh.ru/miniapp/example123/image1.png",
"name": "T-shirt without options",
"options": [],
"price": 1200,
"quantity": 1,
"video": "https://video.ru/video1/"
},
{
"categories": ["Footwear", "Sneakers"],
"currency": "RUB",
"image": "https://storage.leadteh.ru/miniapp/example456/image2.png",
"name": "Sneakers with parameters",
"options": [
"42",
"Black"
],
"price": 4500,
"quantity": 2
}
]
Handling an event in the bot scenario
If the constructor has a created and active event handler, when the event triggers, the scenario you specified in the handler settings will launch. In this scenario, event variables will be available — see the variable list in the table #Mini App event list
You can use these variables like any other variables, for example, add them to a Message Chain block text or check variable values with a Condition block.
Information
Important! These variables are local.
 (1).png)
Using a variable in a Message Chain block
.png)
Using an event variable in a Condition block
Creating an online store in Telegram with mini-app events — sales automation and customer retention
Video lesson on creating an online store in Telegram using app events.
Learn how to set up a product catalog, integrate with YooKassa, create an automatic promo code sending system for abandoned carts, configure order notifications, and fully automate the sales process without programming.
🎁 Free course on chat bot and mini-app development for all users with an active PRO subscription is already available on LEADTEX.
10 detailed lessons covering everything from A to Z.
Start learning now — Start learning.