globall.dev - Telegram bot studio globall.dev
Integrations and CRM

Telegram leads arrive automatically at the right stage of your sales pipeline

Telegram bot plus Mini App for collecting leads with full integration of CRM: each application automatically creates a deal with a UTM source, and the operator corresponds with the client directly from CRM. Zero manual transfer.

Niche: Lead collection + CRM Type: Bot + Mini App Stack: Python · Aiogram · PHP · CRM API
0
Manually transferring applications to CRM - the lead falls into the funnel itself
7
Auto funnel messages with customizable delays
3
UTM tag formats are parsed from deep link
↔
Two-way chat: Telegram ↔ CRM in both directions
Problem

Leads were lost between Telegram and CRM

When applications come to Telegram, and sales are carried out in CRM, there is always a person with copy-paste sitting between them. The manager reads the dialogue in the bot, manually creates a contact in CRM, rewrites the phone number, sets the funnel stage, and does not forget to add a note. On ten leads this is annoying; on stream - leads are easy are lost: someone stayed in the chat and didn’t get to CRM, someone was answered a day later, when he had already gone to a competitor.

Second pain it's unclear where the lead comes from. Advertising runs in several channels, the links are different, and in CRM all requests look the same “came from Telegram”. It is impossible to understand which source pays off and which wastes the budget, because the UTM tag is lost at the entrance to the bot.

Third - first touch speed. While the lead is “warm”, he needs to respond in the first minutes. But the manager does not sit in the chat 24/7, and the application cools down before anyone gets around to it.

The task was formulated as follows: construct a contour where the lead himself reaches the desired stage of the funnel with a clear source, receives an instant response, and the operator does not leave the usual CRM.

Approach

Bot as an entrance to a funnel, CRM as a workplace

We did not retrain managers for the new interface. The scoping principle was simple: Telegram is a capture channel, CRM is a workplace. The bot must do all the dirty work of delivering the lead to the funnel, and the operator continues to work where he is used to.

We divided the project into four circuits:

  1. Capture and qualification. Mini App with an application form instead of an endless chat dialogue - the client leaves structured data in a minute, which immediately goes into the transaction fields.
  2. Source. UTM tags come from the advertising link and reach the custom fields of the deal in CRM - so that for each lead it is clear where it comes from.
  3. Speed. A message funnel catches the client in the first seconds and warms him up while the manager is free.
  4. Work in CRM. Two-way chat so that the operator responds to the lead directly from the CRM card, and does not switch back to Telegram.

The connection “bot → CRM” was built on official CRM API v4, and not on fragile third-party connectors. This means OAuth authorization, control over field structure, and predictable behavior as load increases.

Solution

What ultimately works

The result is an end-to-end contour from an advertising click to a transaction in the funnel - without a single manual transfer.

Application form in Mini App

Instead of asking questions in chat, the client opens Telegram Mini App and fills out the form: name, phone number in E.164 format, business area, city, readiness scale from 1 to 10 and consent to data processing. This immediately gives the manager a qualified lead with fields, and not a raw dialogue that still needs to be deciphered.

The order itself creates a deal

Once the form is submitted, CRM API v4 a contact and a deal are automatically created at the desired stage of the funnel, notes are added, and UTM tags go into custom transaction fields. The manager opens CRM and sees a ready-made card with the source - he does not need to enter anything manually.

The lead source is always visible

The bot parses UTM parameters from deep link into three formats: simple source, key-value pairs and Base64-encoded query string. Plus included UTM link generator, so that the marketer himself collects tags for each campaign. As a result, in the CRM, for each lead you can see which advertisement brought him.

The funnel catches the lead in the first seconds

While the manager is busy, he guides the client auto funnel of 7 messages with customizable delays - instantly, in a minute, in a day, and so on. Once the client fills out the form, the chain stops automaticallyso as not to duplicate live communication. This closes the gap between “lead arrived” and “manager responded.”

Two-way chat Telegram ↔ CRM

User messages from the bot are sent to CRM as notes, and The operator’s responses are sent directly from CRM to the client in Telegram. Implemented on the amojo Chat API with HMAC signature - the operator corresponds with the lead without leaving the deal card.

Admin panel and control

The owner has a dashboard with statistics on conversion, UTM sources and graph for 14 days, auto funnel chain editor with media support and bot control (start / stop / restart). And for every new application it comes instant notification in Telegram — the lead will not go unnoticed.

Technically

Under the hood

CRM integration

CRM API v4
Automatic creation of contacts and deals at the desired stage of the funnel, updating statuses and adding notes.
OAuth 2.0 with auto-refresh
Authorization in CRM with automatic token renewal upon expiration - integration does not fall off.
UTM in custom transaction fields
The source of the request is transferred to the custom fields of CRM - you can see what advertisement brought the lead.
Two-way chat via amojo
amojo Chat API with HMAC signature: client messages → notes in CRM, operator responses → in Telegram.

Lead Capture and Qualification

Mini App with application form
Name, telephone (E.164), business sector, city, readiness scale 1–10 and consent to data processing.
Parsing UTM from deep link
Three formats: simple source, key-value and Base64-encoded query string, plus a UTM link generator.
Instant notification to the admin
With each new application, the owner immediately receives a notification in Telegram - the lead is not lost.
Consent to data processing
Consent checkbox in the form - the data is collected correctly from the point of view of 152-FZ.

Auto funnel and scheduler

Chain of 7 messages
Customizable delays (instant → 1 min → 24h → ...), auto-stop after filling out the form.
APScheduler according to schedule
The scheduler checks the queue every minute and sends chain messages exactly on time.
Media chain editor
Auto funnel messages are edited in the admin panel along with the media - without restarting the bot.
Statistics dashboard
Conversion, UTM sources and application schedule for 14 days - you can see what works.

Infrastructure and data

Managing a bot from the admin panel
Start / stop / restart directly from the panel - without access to the server.
SQLite: leads, UTM, chains, tokens
Users with UTM and link to CRM, requests, daily statistics, chain messages, CRM tokens.
Webhook + Nginx + SSL
Webhook mode for Nginx reverse proxy with Let's Encrypt SSL - stable reception of events.
Python Aiogram + PHP
A bot on Aiogram, Mini App and part of the backend on PHP - a bundle for a specific client infrastructure.
Python Aiogram PHP Telegram Mini App CRM API v4 SQLite Nginx + SSL
Result

The lead reaches the funnel himself

The output is a circuit where each lead gets to the right stage of the CRM funnel with a UTM source and two-way chat. The manager opens CRM and sees a ready-made card with filled in fields and the source of the application - copy-paste from Telegram to CRM has disappeared as a class. The client receives an instant response from the auto funnel while the operator is free, and the operator responds directly from CRM without switching to the messenger.

The main thing is the source is no longer a mystery. The dashboard shows which campaign is bringing in leads, and the budget can be shifted to what actually pays off, and not to what “seems to work.”

Specific figures for conversion and cost per lead are private client data and are provided upon request for a specific project, without fictitious metrics.

If you need the same combination of “Telegram bot → CRM” - with automatic deal creation, a UTM source in the funnel, an auto funnel and two-way chat - this is exactly the mechanics that we assemble turnkey. Under CRM, Google Sheets or other CRM, the logic is transferred using the same approach.

Do you want leads to fall into your CRM themselves?

Tell us about the funnel - we will send you a fixed estimate and deadlines the day before. Lead collection, CRM integration, auto funnel and two-way chat - we collect turnkey, the sources are yours from day one.

For free. I will answer within an hour during business hours. No spam.

We take on a limited number of projects at the same time - this keeps deadlines realistic.

IP Geolocation by DB-IP