Launch Scenario via Deeplink
Deeplink allows creating direct links for launching bot scenarios with parameters. This is useful for creating personalized links from advertising campaigns, passing client ID or order ID, or tracking traffic sources.
What is deeplink?
In messengers, there are mechanisms that allow passing input parameters to a bot. These mechanisms are called deeplink and represent a way to embed a parameter in a link that will open the bot.
📖 Documentation: Read more about deeplink in official messenger documentation:
When to Use Deeplink?
Deeplink is suitable for such cases:
- Launching a scenario from an advertising campaign with unique parameters
- Passing client ID or order ID through a link
- Creating personalized links for different user groups
- Tracking traffic source (UTM tags)
Deeplink Formats for Different Messengers
Telegram
Format:
https://telegram.me/<Bot_Name>?start=<UserID>
Example:
https://telegram.me/mybot?start=12345
Limitations:
- Limit for start parameter: 64 characters
- For subscribing to notifications, clicking the link is not enough, you need to press the "Start" button
Viber
Format:
viber://pa?chatURI=<URI>&context=<UserID>&text=<Start!>
Example:
viber://pa?chatURI=mybot&context=12345&text=Start!
Parameters:
chatURI— your bot's URI in Vibercontext— context (parameter that will be passed to the bot)text— text that will be inserted into the user's input line (optional)
ℹ️ Note: If the
textparameter is not passed, clicking the link will still be considered the start of the conversation and sufficient for subscribing to notifications.
Facebook Messenger
When using deeplink, the start command is passed. Consider this if you use scenario branching with the get_command action.
Launch Scenario via Entry Point Deeplink URL
In any entry point (Entry Point), there is a URL that can be copied to launch the scenario from that point. This is available for:
- Telegram
- Viber
💡 Note: If you don't see the URL, check if the channel is connected to the bot.
Example URL:
https://t.me/botname/?start=n__3
Clicking this link will launch the bot from the specified entry point.
Processing Start Parameter in Scenario
If you want to use the start parameter in the scenario, use the get_command action.
How it works:
- The
get_commandaction processes commands like/commandnameor passed via deeplink - If a parameter is passed, sets the constant
{{messenger_input_param}} - Then you need to parse
messenger_input_paramas convenient through the scenario
Processing example:
// In action jail or through if_else
const param = j.messenger_input_param || '';
if (param === '12345') {
return 'customer_12345';
} else if (param.startsWith('order_')) {
return 'order_tracking';
}
return 'default';
Usage Examples
Example 1: Passing Client ID
Creating link:
https://t.me/mybot?start=customer_12345
Processing in scenario:
Use {{messenger_input_param}} to get the client ID and further processing.
Example 2: Passing Order ID
Creating link:
https://t.me/mybot?start=order_67890
Processing in scenario:
Use {{messenger_input_param}} to get the order ID and further processing.
Limitations
Telegram
- Maximum start parameter length: 64 characters
- Need to press the "Start" button to subscribe to notifications
- Parameter is passed as
/start <parameter>
Viber
- The
textparameter is optional - Clicking the link is sufficient for subscribing to notifications
- Parameter is passed through
context
Facebook Messenger
- When using deeplink, the
startcommand is passed - Consider this if you use scenario branching with the
get_commandaction