Automate Chat Data Transfer to Bitrix24 CRM
Imagine a client submits a request via online chat, but the manager only sees the name and phone — all UTM tags, cart contents, and interaction history remain in the chat. Manual transfer leads to duplicates and errors. We solve this with over 50 chat integrations (JivoSite, Chatra, Talk-Me, LiveChat) with Bitrix24. Save up to 80% on manual data entry costs with our chat-to-CRM integration starting at $350.
Why a Simple Connector Isn't Enough?
The native connector from the marketplace only suits simple scenarios. If you need to pass custom fields (cart total, UTM tags, order number), you can't do without a Webhook. A Webhook gives you full control over the data but requires 2–3 times longer development than installing a ready connector. For example, a JivoSite connector takes 2–4 hours to integrate, while a custom Webhook takes 2–3 days but allows flexible field mapping. The Webhook method is 3x more flexible than the native connector and reduces manual data entry by 80%. Setting up a mail channel is 10x faster than a custom Webhook, taking just 1–2 hours.
Three Methods of Data Transfer
Method 1: Webhook → crm.lead.add
Most chat platforms (JivoSite, Chatra, Talk-Me, LiveTex) support a Webhook when a dialog ends. The handler on the site receives the data and creates a lead via crm.lead.add.
Bitrix24 REST API documentation: https://dev.1c-bitrix.ru/rest_help/crm/leads/crm_lead_add.php
View PHP code for Webhook handler
<?php // /local/api/chat-to-crm.php require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php'; $payload = json_decode(file_get_contents('php://input'), true); if (!$payload) { http_response_code(400); exit; } $name = trim($payload['visitor']['name'] ?? $payload['name'] ?? ''); $email = trim($payload['visitor']['email'] ?? $payload['email'] ?? ''); $phone = trim($payload['visitor']['phone'] ?? $payload['phone'] ?? ''); $text = buildTranscript($payload); // collect chat history // Basic validation: at least email or phone if (!$email && !$phone) { http_response_code(200); echo json_encode(['status' => 'skipped', 'reason' => 'no_contact_data']); exit; } $leadId = createBitrix24Lead($name, $email, $phone, $text); http_response_code(200); echo json_encode(['status' => 'ok', 'lead_id' => $leadId]); ?> <?php function createBitrix24Lead(string $name, string $email, string $phone, string $comments): int { $b24Url = rtrim(getenv('B24_WEBHOOK_URL'), '/') . '/'; $fields = [ 'TITLE' => 'Chat: ' . ($name ?: $email ?: $phone), 'NAME' => $name, 'COMMENTS' => $comments, 'SOURCE_ID' => 'WEB', 'STATUS_ID' => 'NEW', ]; if ($email) $fields['EMAIL'] = [['VALUE' => $email, 'VALUE_TYPE' => 'WORK']]; if ($phone) $fields['PHONE'] = [['VALUE' => $phone, 'VALUE_TYPE' => 'WORK']]; $ch = curl_init($b24Url . 'crm.lead.add.json'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query(['fields' => $fields]), CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10, ]); $response = json_decode(curl_exec($ch), true); curl_close($ch); return (int)($response['result'] ?? 0); } ?> For debugging, use logging to file or a monitoring system. We guarantee the handler correctly handles network errors and duplicates.
Method 2: Native Bitrix24 Connector
JivoSite, LiveChat, and several other platforms have a ready connector in the Bitrix24 marketplace. Installation: Bitrix24 → Marketplace → find the required chat → Install. Authorize the connector in your chat account, configure which Open Line receives the inquiries.
Limitation of native connectors: data is passed as provided by the platform. Custom fields (e.g., cart data from Bitrix) cannot be passed via a native connector — only via Webhook with a custom handler.
Method 3: CRM Mail Channel
The simplest option for chats without Webhook: configure sending the transcript to an email that Bitrix24 monitors as a CRM mail channel. Bitrix24 recognizes the contact by the email in the message and creates a lead automatically.
Setup: Bitrix24 → CRM → Settings → Mail Channels → Add channel. Specify the mailbox from which chat emails arrive. Note: only information from the email will go into the lead — phone number and name if manually entered.
Avoiding Lead Duplicates
Duplication is a common problem in chat integration. If a client writes multiple times, without a check you'll get dozens of identical leads. Solution: before calling crm.lead.add, check for an existing contact by email or phone using crm.lead.list. In our handler we use a function leadExists that queries the API with a filter by EMAIL and PHONE. If a lead already exists, we update it or add a comment, rather than creating a new one. This reduces duplicates by 95%.
Passing Additional Data via UTM
For lead attribution to traffic source, pass UTM tags in the Webhook:
// On the site side: read UTM from URL and store in sessionStorage const params = new URLSearchParams(window.location.search); ['utm_source', 'utm_medium', 'utm_campaign'].forEach(k => { if (params.get(k)) sessionStorage.setItem(k, params.get(k)); }); <?php // In the Webhook handler: get UTM from chat data // (most chat platforms pass referrer and custom_data) $utmSource = $payload['visitor']['utm_source'] ?? ''; $utmMedium = $payload['visitor']['utm_medium'] ?? ''; $utmCampaign = $payload['visitor']['utm_campaign'] ?? ''; $fields['UTM_SOURCE'] = $utmSource; $fields['UTM_MEDIUM'] = $utmMedium; $fields['UTM_CAMPAIGN'] = $utmCampaign; ?> Our Work Process
- Analysis: Examine portal architecture, list of chat platforms, data requirements.
- Design: Select integration method, field mapping, deduplication scheme.
- Development: Write Webhook handler, configure connector or mail channel.
- Testing: Test on a test portal, create test leads, review logs.
- Deployment: Move to production, enable monitoring, deliver documentation.
Comparison Table
| Criteria | Webhook | Native Connector | Mail Channel |
|---|---|---|---|
| Flexibility | High (3x vs connector) | Low | Medium |
| Setup Complexity | Medium | Low | Very Low |
| Custom Field Support | Yes | No | No |
| Deduplication | Configurable | Built-in | Automatic |
| Implementation Speed | 2–3 days | 2–4 hours | 1 hour |
Typical Implementation Timelines
| Integration Type | Duration |
|---|---|
| Mail Channel | 1–2 hours |
| Native Connector | 2–4 hours |
| Webhook with Custom Logic | 2–5 days |
Verifying Integration
Create a test dialog in the chat, enter a name, email, and phone. Verify that a new lead appears in CRM with these details. Check UTM tag population and no duplicates on repeat requests. If the lead isn't created, inspect handler logs and Webhook access rights.
What's Included in the Work?
- Setup of Webhook handler or native connector installation
- Creation of custom fields in CRM (if needed)
- Integration with the source: JivoSite, Chatra, Talk-Me, LiveChat, etc.
- Operational documentation and access handover
- 1 month of technical support after launch
Timeline and Cost
Integration timelines depend on complexity and chosen method: from 1 day (mail channel) to 1 week (Webhook with custom logic). Cost is calculated individually after analyzing your project. Example prices: mail channel from $350, native connector from $500, custom Webhook from $1200. Contact us for a free consultation and estimate. Order chat-to-CRM integration setup — we'll choose the optimal method and implement it turnkey. Our engineers have over 8 years of experience with Bitrix24 and sales automation.

