> 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="/files/E2zkyeSLC4NPe7MCYkrH" alt=""><figcaption><p>Пример для отправки Админу в мессенджер</p></figcaption></figure>

<figure><img src="/files/xteyWR1waomUWsNDPGEx" alt=""><figcaption><p>Пример для CRM</p></figcaption></figure>

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

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

   <div align="left"><figure><img src="/files/U8G0qHFCR6tOTj2B4Yay" alt=""><figcaption></figcaption></figure></div>
6. Проведём диалог и добьёмся выполнения функции.
7. После этого проверим присланный отчёт и увидим, что передался параметр **from\_tg**.\
   ![](/files/1RkMQ5LOM6q1W1ld3JCv)

## Дополнительная информация по 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
