Home · Blog · A Telegram bot link with a start parameter: how to know where a person came from
A Telegram bot link with a start parameter: how to know where a person came from
Telegram has no UTM tags: a person tapped “Start” — and the bot does not know whether they came from a channel post, a business card or an ad. The solution is built into Telegram itself — a link with a start parameter. We look at how it works, how to count visits by each label in CHBT, send people to different flow branches and keep the source in the customer card.
How a link with a start parameter works
An ordinary link to a bot is https://t.me/bot_name. A link with a label is https://t.me/bot_name?start=kassa. When a person opens it and taps “Start”, the bot receives the command /start kassa — that is, it learns the label.
Telegram's rules: a label is up to 64 characters, only Latin letters, digits, underscore and hyphen. Spaces, Cyrillic and dots will not work. In CHBT labels are even shorter — up to 40 characters, lowercase Latin letters, digits, “_” and “-”.
An important detail: the label arrives only when the bot is started via the link. If a person is already talking to the bot and just writes to it, there will be no label.
Where a label comes in handy
- Channel posts and stories —
post_oct,stories: which content brings people to the bot. - Offline — a stand at the checkout, a business card, a flyer, an insert in an order: each place gets its own code.
- Ads — different labels for different ads or platforms.
- Partners and bloggers — each has their own link, so you can see who brought how many.
- Website — a “Message us on Telegram” button on different pages with different labels.
How to make a link and count visits in CHBT
- Connect a Telegram bot in “Channels”.
- Open “QR campaigns” → “New campaign”. Fill in “Name” and, if you like, “Label” in Latin letters (otherwise it is made from the name).
- Click “Create QR”. The “Link” button copies the address with the label for a post or ad, “Download” saves a PNG image with the QR code for printing.
Each start of the bot via the label adds one to the campaign counter, and the total for all links is shown above the list. Starts are counted, not unique people: if one person opens the link twice, it counts as two.
The “QR campaigns” section is available on all plans, and the number of campaigns is unlimited. More about codes for printing — on the QR code for a Telegram bot page.
Different flow branches for different labels
A label is not just a counter. A flow has a “Deeplink” trigger: it starts a branch if the label matches a pattern. The pattern is a regular expression, so one branch can catch a group of labels:
^kassa$— only the checkout code;^blog_— all blogger labels,blog_anna,blog_ivan;^promo— ads.
If several flows match, the one created earlier fires. If none matches, the ordinary flow with the “Command (/start)” trigger starts, as when starting without a label. So a person is never left without an answer.
Example: a package insert leads to the warranty and instructions, a stand in the shop leads to booking, a channel post leads to a lead magnet. A ready-made flow for inserts is the “Buyer bot” template.
How to keep the source in the customer card
The label itself is not written to the contact card — it lives only at the moment of the start. To keep the source for good, make the first step of the “Deeplink” branch an “Action” → “Add tag”, for example src-kassa.
From then on this tag works everywhere: “Contacts” shows how many people came from the checkout; you can send a broadcast by the tag; in the “CRM” you can create a deal with a clear source. How to build a tag system — in the article “Tags as a segmentation system”.
What about MAX and VK?
In MAX CHBT accepts the label if MAX passed it along with the bot start, and counts it in the campaign too. But “QR campaigns” currently build links and QR codes with a label only for Telegram: we have not yet verified the format of such links in MAX. VK has no start-label mechanism — there it is easier to mark the source with a separate keyword in a post (“write ‘checkout’”), caught by the “Keywords” trigger.
How to name labels so you do not get confused later
In six months you will have two dozen campaigns, and test2 will tell you nothing. A simple system:
- place_detail:
kassa_msk,vizitka,vkladysh_wb; - channel_month for content:
post_nov,stories_nov; - a shared prefix for groups caught by one branch:
blog_anna,blog_ivan→ pattern^blog_; - no personal data: anyone who opened the link sees the label.
Name the tag in the card the same as the label, with a source prefix — src-kassa_msk — then the filter in “Contacts” and the campaign counter speak the same language.
Example: three labels — three branches
A coffee shop with delivery sets up three codes:
| Label | Where | What the bot does |
|---|---|---|
stol | a sticker on the table | the menu and a “Call the barista” button |
paket | the delivery bag | an order review and a promo code for the next one |
insta_bio | a link in a social profile | a subscription to news and announcements |
Each branch starts with a source tag. A month later you can see that three times more people come from the bags than from the tables — and the decision about new stickers is made by the numbers.
A label in ads: how to compare ads
When an ad leads straight to a Telegram bot, the ad account sees the click but does not know what happened next. A label closes this gap:
- For each ad or platform create a separate campaign in “QR campaigns”:
ad_vk_1,ad_vk_2,ad_tg_ads. - In the ad use the link from that campaign's “Link” button.
- In the flow one “Deeplink” branch with the pattern
^ad_sets the tagsrc-ads, and the label itself tells the ads apart by their counters. - A week later compare clicks in the ad account against bot starts in the campaign counter, and starts against result tags in “Contacts”.
This shows not only which ad collects clicks but also which one brings people who get as far as a request.
A label on a website: the “Message us on Telegram” button
If a website has several pages with a button leading to Telegram, give each one its own link: site_price for the pricing page, site_contacts for contacts, site_blog for articles. The bot can greet people differently — on the pricing page it makes sense to offer a quote right away, from an article — a subscription to new posts. And the counters show which page really brings people to the messenger.
If a CHBT chat is already on the site, the move to Telegram can also be made from the widget itself — with an “Opens link” button with a label. Keep in mind: in Telegram this will be a new contact, and the conversation history from the website chat will not carry over.
How to check that the label works
- Copy the campaign link and open it on a phone where the bot has not been started yet — or stop the bot and start it again.
- Tap “Start”. The bot should answer with this label's branch, not the general greeting.
- Refresh “QR campaigns” — the campaign counter has gone up by one.
- Open your own card in “Contacts” — the source tag should appear there.
- If the general greeting answered, check the pattern in the “Deeplink” trigger: the regular expression must match the label, and the flow must be enabled.
Common mistakes
- Cyrillic or a space in the label — Telegram opens the bot without the label.
- One link for everything — then the label distinguishes nothing. Make a separate campaign for each placement.
- No tag in the branch — the counter shows visits, but later you cannot tell which customer came from where.
- Tested with a bot already started — to check, open the link and tap “Start”; the counter will go up by one.
QR code for a Telegram bot“Buyer bot” templateChatbot analyticsTags as a segmentation system