> For the complete documentation index, see [llms.txt](https://doc.nextbot.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.nextbot.ru/functional/integrations/telegram/peredacha-metok-iz-telegram-s-ispolzovaniem-deep-linking.md).

# Передача меток из Telegram с использованием Deep Linking

## Описание задачи

Есть несколько источников трафика, и необходимо определить, какой из них эффективнее.

**Решение:** использовать ссылки на Telegram бота с использованием механизма **Deep Linking**.

В параметр `start` можно передать дополнительные значения, например:

```
https://t.me/YourBot?start=from_vk
```

или

```
https://t.me/YourBot?start=from_landing
```

## Пошаговая настройка

1. К ИИ-Агенту подключен Telegram бот по [инструкции](/functional/integrations/telegram/podklyuchenie.md)
2. Предположим, что есть два источника трафика:
   * Telegram-канал
   * лендинг
3. Для каждого источника создайте отдельную ссылку на бота с параметром Deep Linking:

   * Для Telegram-канала:

     ```
     https://t.me/YourBot?start=from_tg
     ```
   * Для лэндинга:

     ```
     https://t.me/YourBot?start=from_landing
     ```

   *(Замените `YourBot` на **имя пользователя** вашего бота в Telegram.)*<br>
4. В функции для отправки результатов (например, в мессенджер или в CRM) выберите следующие параметры:
   * **Имя переменной (Поле сделки)** — желаемое название или поле сделки
   * **Действия** = Данные пользователя
   * **Передаваемое значение** = Переменные из запроса `telegram /start`

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FJnC4Y5FphqdSO3SZyYR5%2Fimage.png?alt=media&amp;token=7a583d87-6e16-417b-902d-6c86e8892eac" alt=""><figcaption><p>Пример для отправки Админу в мессенджер</p></figcaption></figure>

<figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2F0gWBewCfduXxKJLwJvGB%2Fimage.png?alt=media&amp;token=eae6fcdb-13ba-4022-8ea8-5fc74b6d6440" alt=""><figcaption><p>Пример для CRM</p></figcaption></figure>

5. Проверим, как это работает.

   Перейдём по ссылке и согласимся открыть Telegram.\
   *(В текущем примере настроена отправка отчёта в Telegram-группу.)*<br>

   <div align="left"><figure><img src="https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FvZIJJl4s6fRkyGLtq2s6%2FScreenshot%202025-08-11%20100914.png?alt=media&amp;token=5c079f07-c4bd-461d-8c64-837d12787017" alt=""><figcaption></figcaption></figure></div>
6. Проведём диалог и добьёмся выполнения функции.
7. После этого проверим присланный отчёт и увидим, что передался параметр **from\_tg**.\
   ![](https://2593311972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fef2EBU68XAlye1NtG8DF%2Fuploads%2FmMNQyPlOQ6UVagVpgDsv%2FScreenshot%202025-08-11%20101116.png?alt=media\&token=3b1b6ef9-5b43-4f99-bff0-4b6f92049eb6)

## Дополнительная информация по deep link

* Максимальная длина параметра — **64 байта** (не символов).
* Не используйте специальные символы, требующие URL-кодирования (пробелы, кириллицу, спецсимволы).
* Для передачи нескольких параметров объединяйте их в одну строку с разделителем (`_` или `-`).

\
Пример:

```
https://t.me/YourBot?start=param1_param2_param3
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.nextbot.ru/functional/integrations/telegram/peredacha-metok-iz-telegram-s-ispolzovaniem-deep-linking.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
