Activity: Telegram Bot
Last updated
Was this helpful?
Last updated
Was this helpful?
This document provides a detailed guide on creating and configuring a Telegram Bot, enabling you to create Journey flows and utilize the chat functionalities described in the communications guide effectively.
Note:
Telegram Bot is an additional service that requires activation, please contact your Success Manager on Smartico side to get more details.
In order to start using Telegram bot as communication channel you will need to complete following steps:
Create a Telegram bot for your brand(s) using Telegram application.
Setup configuration details of the bot on Smartico side.
Invite users in the Telegram bot, so their profile in Telegram is connected with profile on Smartico side.
Create telegram messages as resources in Smartico BackOffice.
Start using Realtime and Scheduled campaigns to communicate with your users.
Open the Telegram application on your laptop or mobile device.
Search for a bot called BotFather and start a chat with it.
Send the command /newbot to create a new bot.
Set a name for your bot (e.g., My Casino Bot).
Choose a unique username for your bot, ensuring it ends with “bot” (e.g., MyCasinoBot). Important: Remember this username, as you will need it for the Smartico setup.
Once the bot is created, BotFather will provide an API token. Important: Save this token, as it grants access to Telegram’s HTTP API.
Log in to Smartico Back Office and navigate to Label → Instant Messages.
Create a new gateway and select Telegram as the type.
Define an internal name for the gateway and select the appropriate brand representing your bot.
Fill in the required parameters:
Name of the Bot: Use the username from Step 5 in the format @MyCasinoBot (include the “@” symbol).
Telegram Bot token: Enter the token received in Step 6.
Secret for User ID Hashing: Enter a random string to secure the process of linking the Telegram user profile with the casino user profile.
Auth Link: Provide a link to your casino’s front-end. This is used to connect the Telegram user profile with the casino user profile. Example: https://mycasino.com.
By following these steps, you will successfully create and integrate your Telegram bot with Smartico.
Once your setup is completed the user can subscribe to the chat bot by authenticating trough a deep link that connect to Telegram "dp:telegram". For example you can set the deep link to a mission "Join our Telegram" to encourage the user to subscribe. Upon clicking the user will be redirected to Telegram app, automatically open a new chat window and the authentication process will finish.
You can use deep link "dp:telegram" in any other context, for example in the popups or you can also execute it from the front-end code of the web-site.
The Telegram activity is used for sending a communication to the end users via Telegram and it is considered to be an offline communication since it doesn't require the user to be online. This type of communication can be sent only from Campaigns - Real-time and Scheduled.
Inside the flow builder the Telegram activity is located in the communication section.
The telegram activity has the following setup options:
Provider - choosing the Telegram provider that will be used for sending the communication. You can also choose the Automatic Selection (multi-brand setup).
Automatic Selection (multi-brand setup) - used to automatically select the first gateway that meets the conditions. By default, the first condition is Brand, but you can add more user properties. This gives you more flexibility when you want to filter a specific segment of users to use a different gateway, for example.
Allowed Communication hours - used to define how the flow should behave if the time of the sending is in the ‘Do not Disturb’ period of the user.
Telegram message - used to add the asset that will be sent to players, where you can define the message content. Before sending any communication via Telegram, the corresponding asset must be created. You can also add multiple message variations for A/B testing, allowing you to test different versions and optimize engagement. When adding a second variation, you can specify the percentage of the audience that will receive each version, ensuring controlled message distribution.
From the profile page you can check if the user has subscribed to the Telegram chat bot and if so you see the chat ID.
You can create segmentation for all subscribed users by setting the Telegram chat ID to not equal 0 (this finds the users that have Telegram channel enabled).
There are 2 events that are specific for the telegram that you can use to start real-time campaigns, complete missions, execution automation rules to progress in the campaign flows.
When user subscribes to Telegram bot, Smartico will trigger event "Core: telegram auth completed". You can use this event to send a welcome message to the personal channel with user.
When user is blocking/unsubscribing from Telegram bot, Smartico will trigger "Core: telegram unsubscribed" event.
Q: I have setup campaign to send messages but they are not delivered
A: Check following configurations
You are targeting users that are subscribed to telegram bot, you segment conditions should check for "Telegram chat id" <> 0
You have "Instant messages" enabled in the label settings
Your DnD period is set properly for "Instant messages"
Q: How I can do a new line in the Telegram message. Tried <br> and <p>, but they are not supported
A: Telegram has limitted set of support HTML tags, to ahieve a new line you can put an empty <pre></pre> pair of tags
Q: How delivery/impressions/clicks are tracked in reporting for telegram messages?
A: Telegram as a platform is not providing information if message was delivered or was seen by user, though on Smartico side we have only information like
Created - first fact, indicating that communication is created by activity in the campaign
Send - fact that communication was sent by Telegram bot (altough doesn't indicate if successefully sent)
Failed - failed to delivery message
Click - user clicked on the link to button in the message