Streamline Lead Acquisition: Import from Yandex.Direct to Bitrix24
We constantly encounter situations where requests from Yandex.Direct lead forms remain in the advertising account or in Metrica. The manager has to manually transfer data to the CRM — leads "hang" for hours, some are lost during copying. Automatic import via webhook or Leads API removes the human from the chain and reduces reaction time to seconds. This automation typically saves $500-$1,000 per month in labor costs and reduces lead loss by up to 80%.
How Does Yandex.Direct Webhook Work?
Yandex.Direct sends a POST request to the specified URL immediately after a lead form is filled out. The handler receives the data, verifies the signature (HMAC-SHA256), and creates a lead in Bitrix24 via the REST method crm.lead.add. The entire process takes less than a second. Webhook import is 10 times faster than manual data entry and reduces lead loss by up to 50%.
Steps to implement:
- Create a PHP script to receive POST requests.
- Verify the HMAC-SHA256 signature.
- Map form fields to Bitrix24 lead fields.
- Call crm.lead.add via REST API.
// webhook/yandex-direct-leads.php
$rawBody = file_get_contents('php://input');
$data = json_decode($rawBody, true);
// Signature verification (HMAC-SHA256)
$signature = hash_hmac('sha256', $rawBody, YANDEX_WEBHOOK_SECRET);
if ($signature !== $_SERVER['HTTP_X_YANDEX_SIGN'] ?? '') {
http_response_code(403);
exit;
}
// Mapping Direct form fields to Bitrix24 lead fields
$leadData = [
'TITLE' => 'Lead from Yandex.Direct: ' . ($data['campaign_name'] ?? ''),
'NAME' => $data['answers']['name'] ?? '',
'PHONE' => [['VALUE' => $data['answers']['phone'] ?? '', 'VALUE_TYPE' => 'WORK']],
'EMAIL' => [['VALUE' => $data['answers']['email'] ?? '', 'VALUE_TYPE' => 'WORK']],
'SOURCE_ID' => 'ADVERTISEMENT',
'SOURCE_DESCRIPTION' => 'Yandex.Direct',
// UTM tags from form parameters
'UF_CRM_UTM_SOURCE' => $data['utm_source'] ?? 'yandex',
'UF_CRM_UTM_MEDIUM' => $data['utm_medium'] ?? 'cpc',
'UF_CRM_UTM_CAMPAIGN' => $data['utm_campaign'] ?? $data['campaign_id'] ?? '',
'UF_CRM_UTM_TERM' => $data['utm_term'] ?? '',
'UF_CRM_AD_ID' => $data['ad_id'] ?? '',
'UF_CRM_CAMPAIGN_ID' => $data['campaign_id'] ?? '',
];
// Send to Bitrix24
$b24 = new BitrixWebhookClient(B24_WEBHOOK_URL);
$result = $b24->call('crm.lead.add', ['FIELDS' => $leadData, 'PARAMS' => ['REGISTER_SONET_EVENT' => 'Y']]);
How to Use Yandex.Direct Leads API?
If the lead form does not support webhooks (older forms), we use polling via the Yandex.Direct API. Every 5 minutes, a script checks for new leads from the last period and creates them in the CRM. It is critical to ensure idempotency — store IDs of already processed leads in Redis or a table.
// Cron every 5 minutes: check for new leads
public function importNewLeads(): void
{
$token = YANDEX_OAUTH_TOKEN;
$lastImportTime = $this->getLastImportTime(); // from Redis/file
$response = $this->yandexApiRequest('GetLeads', [
'SelectionCriteria' => [
'DateTimeRange' => [
'From' => $lastImportTime->format('Y-m-d\TH:i:sP'),
'To' => (new DateTime())->format('Y-m-d\TH:i:sP'),
],
],
]);
foreach ($response['Leads'] as $lead) {
if (!$this->isAlreadyImported($lead['LeadId'])) {
$this->createLeadInBitrix24($lead);
$this->markAsImported($lead['LeadId']);
}
}
$this->saveLastImportTime(new DateTime());
}
How to Handle Duplicate Leads?
Without deduplication, one click on a form can result in two leads. Basic check: before creating a lead, search for a record with the same phone number within the last 24 hours. If it exists, add a comment to the timeline instead of creating a duplicate. Deduplication by email works similarly — especially relevant for forms where the user does not provide a phone number. For B2B segment, we set up an additional check by company and position: two different employees of one organization are created as separate leads, but automatically linked to the same company in the CRM. Deduplication prevents duplicate entries, saving 10-15% of CRM budget.
Code example for deduplication
$existing = $b24->call('crm.lead.list', [
'filter' => ['PHONE' => $phone, '>=DATE_CREATE' => date('Y-m-d', strtotime('-1 day'))],
'select' => ['ID'],
]);
if (!empty($existing)) {
// Add comment to existing lead instead of creating a duplicate
$b24->call('crm.timeline.comment.add', [
'ENTITY_TYPE' => 'lead',
'ENTITY_ID' => $existing[0]['ID'],
'COMMENT' => 'Repeat request from Yandex.Direct: ' . $data['campaign_name'],
]);
return;
}
Lead Distribution by Responsible Manager
After creating a lead, a responsible manager is automatically assigned. The mapping of Yandex.Direct campaign to employee is stored in a configuration file or in CRM user fields. Alternatively, use Bitrix24 robots for distribution according to funnel rules.
For example, the campaign "Context — Moscow Region" always assigns a manager from the Moscow office, while campaigns for product X assign a narrow specialist. This approach reduces first response time by 35% because the lead directly reaches a competent person, without reassignments.
When using robots, the logic can be easily changed without programming: just open the funnel editor and adjust the conditions. Robots support distribution by load (queue), by region from UTM tag, or by time of day.
Monitoring Integration Health
Without monitoring, a webhook failure can go unnoticed for hours, missing dozens of leads. We configure:
- A log file of all incoming requests with timestamp and processing status.
- An alert to email or Slack if no lead arrives within 30 minutes during working hours.
- A backup polling once an hour for reconciliation: compare leads from Yandex.Direct API with those already created in Bitrix24.
Retry mechanism: if Bitrix24 is unavailable (maintenance or reboot), the webhook saves data to a temporary table with a timestamp and retries after 5 minutes. The cycle continues until successful processing. This completely eliminates lead loss during planned technical work on the server. Additionally: all retries are written to a log file, and upon successful processing of a "delayed" lead, the manager receives a notification with the delay time — this helps correctly prioritize callbacks. Best practices from Bitrix24 partner documentation.
What's Included in the Service
| Stage |
Details |
| Form analysis |
Check the structure of Direct fields, determine mapping to lead fields |
| Webhook setup |
Register URL in the account, implement handler with verification |
| Mapper development |
Map fields: phone, name, email, UTM, campaign_id |
| Deduplication |
Implement phone check within 24 hours, logging |
| Distribution |
Configure responsible manager assignment by campaign |
| Documentation & Training |
Provide setup documentation, integration logs access, and manager training |
| Support |
Ongoing support and monitoring alerts |
Timeline & Cost: from 3 to 5 days with ready server and CRM infrastructure. If custom fields and distribution rules need configuration — up to 2 weeks. Estimated cost ranges from $300 to $800. The final price is calculated individually after analyzing your forms — contact us for a project estimate. Our experience: over 20 integrations with Yandex.Direct, 5 years on the market. We guarantee no duplicates and no lead loss.
Get a consultation on import automation — write to us, and we'll set up seamless lead transfer to Bitrix24.
How to ensure CRM implementation success?
We have been working with Bitrix24 for over 10 years — during that time we have completed 500+ projects. Every second one starts with the same problem: a company buys CRM, sets it up "by the book," and three months later managers fill two out of twelve fields, deals stall at "Negotiations" for months, and management cannot extract analytics. The root is not bad software — it's the approach. CRM is configured without auditing real processes, without considering staff objections, and without a step-by-step automation plan. In this article — a step-by-step guide on how we avoid this.
All specialists are certified by 1C-Bitrix, the methodology is proven on hundreds of cases. 1C-Bitrix is a platform that, when paired with Bitrix24, provides real end-to-end analytics if configured correctly.
Reality of CRM implementations: 80% fail to deliver results
Why do employees sabotage CRM?
Managers are accustomed to Excel and notepads — they perceive CRM as total control. Our solution: involve key employees at the design stage, show personal benefits — automatic reminders, ready-made proposal templates, less routine. We train on real scenarios, not abstract examples. Resistance drops 4 times faster than with "command" implementation.
How to prevent incomplete data entry?
Mandatory fields are filled, others are ignored — familiar picture? We solve it on three levels:
- Set mandatory fields per funnel stage (only relevant data at each stage).
- Implement auto-fill from UTM tags, email parsing, data from open databases.
- Remove redundant fields — fewer fields, higher quality.
According to our practice, field optimization reduces omission rates by 70% within the first month.
How to design funnels correctly?
Too many stages, no transition criteria, duplicate stages — typical mistakes. We design the funnel based on reality: how sales actually work, not as written in textbooks. We use CRM data from the first 2 weeks of audit to identify real stages and loss points. This shortens the deal cycle by 25–40%.
What automation should be done first?
We set up robots and business processes from day one — so the team immediately feels the difference. For example, lead distribution, sending emails after status changes, creating tasks for colleagues. Companies that implement automation at the start achieve plan targets 3 months faster.
What Bitrix24 features accelerate sales?
- Inquiries from all channels (phone, email, messengers, forms) are captured automatically.
- Leads are created and distributed without manual intervention.
- Visual kanban with custom stages — drag a card to the next stage, an email is sent automatically, a task is created.
- Omnichannel: unified window for telephony, email, WhatsApp, Telegram, Viber, VK, Instagram, online chat.
- Robots and business processes: mailings, document generation, reminders, escalations — no coding required.
- Analytics: funnel, conversions, lead sources, manager workload, average handling time.
What does integrating a 1C-Bitrix website with Bitrix24 CRM provide?
Synergy of the two products yields measurable results, and we implement it through direct data exchange. Site forms transfer leads to CRM instantly with full UTM markup — you see where the client came from. Online chat connects via open lines: a visitor writes on the site, the manager responds from CRM. Orders in the store based on infoblocks v2.0 become deals with full purchase history, enabling cross-selling. Call tracking with number substitution links calls to advertising channels. We use CommerceML to exchange data with 1C Trade Management/ERP: nomenclature, stock balances, prices — synced via agents without manual intervention. End-to-end analytics collects advertising costs, visits, leads, sales in one report — ROI per channel. For non-standard logic, we use REST API and high-load blocks to store arbitrary data (e.g., tech support interaction history). In one project, we configured this bundle for a retail chain: 1C cash register integration with CRM created contacts automatically upon loyalty card purchase, and CRM marketing via Bitrix24 increased repeat purchases by 18% in six months.
How we set up CRM: the process
-
Audit. We analyze how sales work currently. Where are leads lost? Which channels bring clients? We form recommendations before technical implementation.
-
Design. Multiple funnels for different directions, custom fields, mandatory stages and transition conditions. Structure reflects the real process.
-
Integrations. Connect to website, telephony, email, messengers, Yandex.Direct, Google Ads, 1C.
-
Custom modules. When standard is not enough — applications for Bitrix24: specific reports, non-standard business logic, integrations with industry systems.
-
Migration. Transfer databases from amoCRM, Megaplan, Salesforce, HubSpot, Excel. Relationships, communication history, attachments — everything intact.
-
Training. Trainings tailored to your configuration, video instructions, documentation.
What is included in the work?
| Deliverable |
Description |
| Technical documentation |
Funnel scheme, robot settings, field structure, integration plan |
| Access and configurations |
List of integrations, API keys, logins/passwords (provided under NDA) |
| Team training |
2–3 webinars tailored to your configuration, video instructions, cheat sheets |
| Post-implementation support |
2 weeks of incident management + regular usage audits |
Cloud or on-premise: which to choose?
| Parameter |
Cloud (SaaS) |
On-Premise |
| Time to start |
1–2 days |
1–2 weeks |
| IT requirements |
None |
Server and admin required |
| Data control |
Limited |
Full |
| Customization |
Standard limits |
Unlimited |
| Best for |
Teams up to 100 people, standard processes |
Large companies, strict security requirements |
Comparison: the cloud version is 2–3 times cheaper initially, but for B2B companies with large data volumes, on-premise pays off in 1.5–2 years due to no per-user subscription fee.
Metrics we track for your business
-
Funnel stage conversion. If 80% are lost at the proposal stage — the problem is pricing, not managers. Norm: 5–15% for B2B, 1–5% for high-ticket B2C.
-
Lead response time. A 5-minute response increases conversion 10x compared to a 30-minute response. We set alerts — if a manager doesn't respond within 15 minutes, the lead is reassigned.
-
LTV. CRM segments clients by lifetime value — managers focus on the most valuable.
-
Average deal cycle. If it increases, something is broken. Reasons for rejections are gold for product and script adjustments.
Our case studies
Manufacturing company (B2B). A plant with high annual turnover. Leads were lost in email; management only learned about large deals post-factum. We set up automatic inquiry capture, a funnel "qualification → calculation → proposal → approval → contract → payment," and robots that generate proposals from templates. Conversion increased by 23%, lead processing time dropped from 4 hours to 20 minutes. Manager payroll savings exceeded $1,000 per month due to reduced routine.
IT service company. Three funnels: new clients, upselling, tenders. Auto-generation of contracts and invoices, integration with Jira — after signing, tasks automatically appear in the development department. Management received a weighted revenue forecast with 90% accuracy. The project paid off in 4 months.
Implementation timeline and cost
| Scale |
Timeline |
What's included |
| Basic |
1–2 weeks |
Funnel, telephony, email, database import |
| Standard |
1–2 months |
Custom funnels, automation, website and 1C integrations |
| Comprehensive |
2–4 months |
Multiple funnels, custom modules, training, end-to-end analytics |
The cost is calculated individually based on your scope of work. After implementation — tech support with SLA (response from 1 hour), regular usage audits, and feature development.
Ready to discuss your situation? Contact us — we'll conduct a free audit of your current CRM within 2 days and propose an implementation architecture with a result guarantee. Request a consultation — we'll show you in numbers how much you'll save with proper setup.