Introduction
Telegram is an instant messaging app that is simple, fast, secure, and synced across all devices. Through Telegram, brands can easily engage with their customers with rich messaging.
MoEngage <> Telegram
MoEngage and Telegram integration allows you to leverage advanced segmentation, predictive capabilities, personalization, and triggering features to message your users in Telegram using the Telegram Bot through the Telegram APIs.
Integration
library_add_check |
Prerequisites
|
info |
Information You can send personalized campaigns only to users with a user identifier (Telegram Chat ID). |
Telegram allows you to send promotional and non-promotional messages to users, provided your brand has secured their consent. To send your users, one of the following conditions must be fulfilled
- Users who have added your Telegram bot
- Users who haven’t added their Telegram bot but have sent a message to your Telegram bot (excluding users who have blocked your Telegram bot)
Step 1: Collect Your Users' Telegram Chat IDs
To send messages in Telegram, you must collect your users’ Telegram Chat IDs to consistently identify and interact with them. Telegram Chat IDs are not the same as the user’s Telegram usernames. Telegram Chat IDs are generated by Telegram and can be used when interacting with Telegram's APIs.
For more information on getting Telegram Chat IDs for Users, Channels, and Groups, refer here.
Step 2: Save the User's Telegram Chat ID on MoEngage
After obtaining a list of Telegram Chat IDs, you must add them to MoEngage as a telegram_chat_id, a custom-tracked user attribute or property. You can do one of the following:
- Pass this data to MoEngage using the User Data API
- Upload it using User Imports inside MoEngage
Step 3: Integrate Telegram with MoEngage
To integrate Telegram with MoEngage, perform the following steps:
- On the left navigation menu in the MoEngage dashboard, click App marketplace. The App Marketplace page is displayed.
- Search for Telegram.
- Click the Telegram tile. The Telegram page is displayed.
- Go to the Integrate tab, and click + Add connection.
- Enter the following details:
Field Description Example Connection name Name of the Telegram connection. My Telegram Bot Telegram Bot Token Your Telegram Bot token. When a bot is created, it is provided with a unique authentication token. For more information on obtaining and generating tokens, refer to Telegram Bot. 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
- Click Connect. Your Telegram connection is now integrated.
You can now use Telegram to start creating campaigns.
Step 4: Create a Campaign on MoEngage to Send a Telegram Message
To create a campaign on MoEngage:
- On the left navigation menu in the MoEngage dashboard, click Engage, and then click Campaigns.
- On the All campaigns page, click + Create campaign.
- On the Create campaign dialog box, under Connected Apps, click Telegram and then click the most suitable delivery type.
- Under Select audience, click Filter users by.
- On the User property tab, select the segment of users for whom telegram_chat_id exists (you can combine it with other segment criteria).
- In step 2 of the campaign, select the pre-configured connectors and specify the content you want to send out. Enter the following details:
Field Description Connector Select a pre-configured connector you want to use. Connections Select the connection you added to the MoEngage App marketplace. Telegram Chat ID Enter the Telegram Chat ID. It is a unique identifier assigned to each user on the Telegram messaging platform. You can also use Personalization here. If you want to send a message to a channel or a group, refer to Send a Telegram message to the Channel or Group Message Enter the message content you want to send. You can also use Personalization here. For more information on Telegram formatting options, refer to Formatting options. Formatting Style Choose your formatting style based on your message content.
Choose the preferred format for how Telegram renders messages to your users. - Your campaign is now ready to be tested and sent. Using the Test functionality, you can also test your connector configuration.
If your test user successfully receives the message, your setup is ready.
- Publish the campaign.
Send a Telegram Message to the Channel or Group
Perform the following steps to send campaigns to your Telegram channel or group:
- Create a new user in MoEngage to message a channel or a group. Ensure the Telegram Chat ID here is your channel ID or group ID.
- Select the user by creating a segment for it. Ensure only one User is included in the segment. When multiple users are selected for the campaign, the message gets sent to the channel or group many times.
- In Step 2 of Create Campaign, enter the Telegram Chat ID of your channel or group. You can also use personalization here.
Campaign Analytics
MoEngage campaigns provide powerful analytics that allow you to analyze your campaign performances. Each channel in MoEngage provides in-depth metrics that help you quantify your campaign goals. For more information on the MoEngage Analytics functionalities, refer to Campaign Analytics.
By default, we provide the following metrics for Telegram campaigns:
- Attempted: After removing the users who breached the frequency capping (FC), Attempted is calculated as the number of users who qualified for the Telegram campaigns and to whom we attempted to send messages.
- Failed: Number of users for whom Telegram did not send any message or the users for whom we failed to find any value against the user or event attributes used in the campaign.
-
Successfully sent: The campaign is marked as successful when Telegram APIs accept the request to send the message to users/groups/rooms (with a 200 status code). For more information on Viber Message API responses, refer to their help documentation.