Automatic setup with a bot token
The fastest way to start using Metriox: connect automatically by providing your Telegram bot token.
What you get
When you connect a token, Metriox automatically:
- Tracks every user who interacts with the bot
- Collects incoming and outgoing messages and other events
- Stores the interaction history
- Lets you start analyzing data right away, with no code integration
How to connect
Step 1: Get the bot token
If you already have a Telegram bot, you already have its token. If not:
- Message @BotFather in Telegram
- Run the
/newbotcommand - Follow the instructions
- Copy the token (it looks like this:
123456789:ABCdefGHIjklmnoPQRstuvWXYz)
Step 2: Add the bot to Metriox
- Open the Metriox app
- Go to Settings → Bots
- Click + Add bot
- Open Bot settings (the gear icon)
- Select the Telegram integration and paste the token
- Turn on the Enable automatic collection toggle
Never publish or share your bot token with anyone. Anyone who knows the token can control your bot. We store the token encrypted and use it only with your permission.
Step 3: Start using it
That's it. Metriox now tracks your bot's events. Open the dashboard and start analyzing.
Automatically captured user properties
On every interaction with the bot, Metriox stores the user's Telegram profile. These properties are available on the Users page and can be used in filters.
Profile properties ($tg.*)
| Property | Type | Description |
|---|---|---|
$tg.telegram_user_id | number | The user's Telegram id |
$tg.first_name | string | First name |
$tg.last_name | string | Last name (if set) |
$tg.username | string | Telegram username (if set) |
$tg.language_code | string | Language code ("ru", "en", and so on) |
$tg.is_premium | boolean | Premium status |
The /start parameter
If a user launched the bot through a deep link (for example, t.me/YourBot?start=ref_abc), Metriox stores the whole parameter in $tg.start_raw. Telegram only lets Latin letters, digits, _ and - into it, up to 64 characters, so it never carries key=value pairs. How to work with deep links is described on the Users page. If the parameter is written as tags like source-tgads_campaign-june, the tags are also stored in $tg.start_source, $tg.start_campaign and the fields beside them.
The profile is updated when Telegram tells Metriox something new about the user. Each property comes from a record that has it, so a later, thinner record does not erase what is already known.
Choosing which events to capture
Not every bot needs everything. In the Telegram integration settings you choose which update categories to record — a simple bot is fine with messages and button clicks, while a bot working with channels and supergroups also wants posts and members:
| Category | What it records | Default |
|---|---|---|
| Messages | messages and edits to them | enabled |
| Button clicks | callbacks from inline buttons | enabled |
| Inline queries | the bot's inline mode | enabled |
| Reactions | reactions to messages | enabled |
| Polls | polls and votes | enabled |
| Payments | payment stages | enabled |
| Business messages | Telegram Business | enabled |
| Channel and supergroup posts | posts and edits to them | disabled |
| Deletions | deleted messages | disabled |
| Joins, leaves, and blocks | chat members, join requests, bot blocks | disabled |
Changes apply without a restart — they are picked up on the next configuration refresh.
The last three categories are off on purpose: in an active channel or a large supergroup they produce a stream of events that is rarely needed in full, so turn it on deliberately.
A token connection receives updates over MTProto. It gives you channels, supergroups, and reactions, but it does not deliver the bot's direct messages (DMs) — only the SDK on top of Bot API brings those. So the "Messages" category alone will not show one-on-one conversations: connect the SDK for the full picture.
Additional events
Besides the automatic events, you can send your own events through the API or the SDK.
What's next?
Once the token is connected:
- Check the data — open the dashboard and watch events in real time
- Build widgets — analyze your data with the dashboard
- Add custom events — use the SDK or the API to send your own events
Feedback? If you have questions, contact support.