Bot link markers: language, Yandex Metrica, ad click
A link to your bot can carry a marker. The platform keeps it on the lead, splits it into fields and sends them in webhooks. A marker lets the agent start the conversation in the right language and lets you tie the lead to a site visit and an ad click.
What the link looks like
- Telegram:
https://t.me/your_bot?start=site_en_ym_1731400000123456789 - MAX:
https://max.ru/your_bot?start=site_ru_ym_1731400000123456789
The start parameter allows Latin letters, digits, _ and -, up to 64 characters. A longer parameter is not stored at all. WhatsApp has no such parameter.
Markers the platform reads
| Marker | Meaning | Webhook field |
|---|---|---|
| site_<language> | The language of the page the client came from. The agent starts the conversation in it. Codes: ru, en, es, pt (or pt-br), id, ar, he, kk, uz. | lead.start_language |
| ym_<ClientID> | The visitor's Yandex Metrica ClientID, digits only. It lets you find the lead in Metrica reports and exports. | lead.ym_client_id |
| yclid_<id> | A Yandex Direct click. | lead.click_id, lead.click_source = yandex |
| gclid_<id> | A Google Ads click. | lead.click_id, lead.click_source = google |
| fbclid_<id> | A Meta click. | lead.click_id, lead.click_source = meta |
| ttclid_<id> | A TikTok click. | lead.click_id, lead.click_source = tiktok |
| rb_clickid_<id> | A VK Ads click. | lead.click_id, lead.click_source = vk |
| msclkid_<id> | A Microsoft Advertising click. | lead.click_id, lead.click_source = microsoft |
How to write them
- A marker is a key and a value joined by _ or -: site_en, ym_1731400000123456789.
- Several markers are joined by _ or - in any order: site_en_ym_1731400000123456789.
- A marker's value runs to the next marker or to the end of the parameter.
- The key is case-insensitive: SITE_EN reads the same as site_en.
- Put your own tag (a promo code, a campaign tag) at the front, before the platform's markers. Text after a marker's value breaks that marker.
- When a marker of one kind appears twice, the first one is used.
- A parameter without markers is not interpreted: it stays whole in lead.start_param.
Examples
| The start parameter | Result |
|---|---|
| site_en_ym_1731400000123456789 | start_language = en, ym_client_id = 1731400000123456789 |
| site_ru_yclid_16234567890123456789 | start_language = ru, click_id = 16234567890123456789, click_source = yandex |
| yclid_16234567890123456789_ym_1731400000123456789 | click_id = 16234567890123456789, click_source = yandex, ym_client_id = 1731400000123456789 |
| promo2026_ym_1731400000123456789 | ym_client_id = 1731400000123456789. Your own tag in front does not get in the way. |
| ym_1731400000123456789_spring | Nothing: the marker's value is followed by other text. Put your own tag at the front. |
| site_de | Nothing: the language is not on the list. The conversation runs in the agent's language. |
| 123456789 | Nothing: the platform does not treat a bare number as a click or a ClientID. |
Conversation language from the site_ marker
- The agent sends the greeting and holds the conversation in the marker's language. The greeting from the agent's script is translated automatically.
- If the client writes in another language, the agent switches to it.
- It works when the agent is allowed that language: the agent card, the “The client may switch to another language” setting. With only the main language left there, the marker has no effect.
- If the client later comes through a link with another language, the conversation continues in the new one. lead.start_language still holds the language of the first link.
How to add the Yandex Metrica ClientID
Only the counter on your site knows the ClientID, so the page builds the link. Ask the counter for the ClientID and append it to the button's address:
ym(COUNTER_ID, "getClientID", function (clientId) {
var link = document.getElementById("telegram-button");
link.href = "https://t.me/your_bot?start=site_en_ym_" + clientId;
});If the counter is blocked, the link keeps only the language, and the conversation still starts in it. In Metrica the ClientID is shown in the “Visitors and customers” report and in Logs API exports.
Where it shows up
- lead.start_param — the whole parameter, as received.
- lead.start_language — the language from the site_ marker.
- lead.ym_client_id — the ClientID from the ym_ marker.
- lead.click_id and lead.click_source — the ad click and its network.
These fields arrive in the lead block of the event webhook and of the lead webhook. A field without its marker is null. On the lead card the markers are shown in the “Traffic source” block.
The first visit wins
The parameter is written to the lead once. Coming again through another link into the same lead does not change start_param or the fields read from it. In MAX the parameter arrives only on the bot's first launch: a client who has already messaged the bot comes without a marker.