Call Tracking & UTM in CRM: Integrate Callibri with Bitrix24

The problem of siloed data Callibri records every call, but without integration with Bitrix, this data stays isolated. The manager sees that a call occurred but cannot determine which ad brought the client. From our observations, up to 35% of ad budget is wasted on low-conversion channels—simply

Our competencies:

Frequently Asked Questions

The problem of siloed data

Callibri records every call, but without integration with Bitrix, this data stays isolated. The manager sees that a call occurred but cannot determine which ad brought the client. From our observations, up to 35% of ad budget is wasted on low-conversion channels—simply because attribution is missing. As a result, marketing hypotheses cannot be tested.

Integration closes the loop: click → call or form → lead with UTM tags. According to official Callibri documentation, the service identifies the call source in 95% of cases—30–50% more accurately than standard call tracking in Yandex.Metrica. After setup, you see not just a call, but its attribution: source, campaign, keyword. Budget savings from disabling inefficient channels reach 30–40% in the first month.

We have implemented over 50 such integrations for clients in e-commerce and services. Typical issues: loss of UTM tags when switching from mobile devices and duplicate leads. Both are solved at the design stage.

How to connect Callibri to 1C-Bitrix?

Callibri provides two mechanisms: JavaScript API for the client side and REST API for server interaction. Full integration with Bitrix needs both.

Data flow diagram for calls:

Visitor → Callibri JS replaces number → Call recorded in Callibri → Webhook from Callibri (POST to your endpoint) → Bitrix handler → Lead/Deal creation in Bitrix CRM → UTM tags attached to deal 

For forms, the schema is similar but initiated by form submission: JavaScript reads callibri_visitor_uid from cookie, sends it together with form data to the server, where a request to Callibri REST API gets visit details.

Why is it important to pass UTM tags to CRM?

Standard Google Analytics only shows overall statistics. Without stitching, you cannot know which channel led to a target call. Callibri identifies the source in 95% of cases—30–50% more accurate than alternatives, e.g., Yandex.Metrica call tracking settings. Ad budget savings reach 30–40% by eliminating inefficient channels. Comparison: webhook method delivers data instantly, while REST API has a 1–5 second delay, critical for real-time reports.

Integration architecture

Setting up a Webhook from Callibri

In Callibri admin panel: Settings → Integrations → Webhook. Specify your handler URL. Callibri sends POST with JSON payload for each call, chat, or request.

Payload structure (key fields):

{ "call_id": "98765432", "call_type": "call", "caller_number": "+79161234567", "call_date": "2024-03-15 14:23:11", "utm_source": "yandex", "utm_medium": "cpc", "utm_campaign": "brand_kw", "duration": 145, "is_target": true, "visitor_id": "callibri_abc123" } 

Handler in Bitrix—a separate component or /local/api/callibri-webhook.php. It receives data, verifies via secret token, and creates a lead. Example code (combined with lead creation):

<?php require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php'); $rawInput = file_get_contents('php://input'); $data = json_decode($rawInput, true); if (empty($data) || empty($data['caller_number'])) { http_response_code(400); exit; } $token = $_SERVER['HTTP_X_CALLIBRI_TOKEN'] ?? ''; if ($token !== \Bitrix\Main\Config\Option::get('local.callibri', 'webhook_secret')) { http_response_code(403); exit; } // Create lead $fields = [ 'TITLE' => 'Callibri Call: ' . $data['caller_number'], 'PHONE' => [['VALUE' => $data['caller_number'], 'VALUE_TYPE' => 'WORK']], 'SOURCE_ID' => 'CALL', 'STATUS_ID' => 'NEW', 'ASSIGNED_BY_ID' => 1, // simplified; in real project — distribution 'UF_CALLIBRI_ID' => $data['call_id'], 'UF_UTM_SOURCE' => $data['utm_source'] ?? '', 'UF_UTM_MEDIUM' => $data['utm_medium'] ?? '', 'UF_UTM_CAMPAIGN'=> $data['utm_campaign'] ?? '', 'UF_CALL_DURATION' => (int)($data['duration'] ?? 0), ]; $lead = new \CCrmLead(false); $leadId = $lead->Add($fields, true, ['DISABLE_USER_FIELD_CHECK' => false]); if (!$leadId) { \CEventLog::Add([ 'SEVERITY' => 'ERROR', 'AUDIT_TYPE_ID' => 'CALLIBRI_LEAD_FAIL', 'MODULE_ID' => 'local.callibri', 'DESCRIPTION' => $lead->LAST_ERROR, ]); } http_response_code(200); echo json_encode(['status' => 'ok', 'lead_id' => $leadId]); 

Attaching a visit to a Bitrix form

Callibri sets the callibri_visitor_uid cookie on the client side. You need to intercept the form submission and add the uid as a hidden field.

JavaScript on the page with the form:

document.addEventListener('DOMContentLoaded', function () { const forms = document.querySelectorAll('form.bx-form, form[data-bitrix-form]'); forms.forEach(function (form) { const uid = getCookie('callibri_visitor_uid'); if (uid) { const input = document.createElement('input'); input.type = 'hidden'; input.name = 'callibri_uid'; input.value = uid; form.appendChild(input); } }); }); function getCookie(name) { const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)')); return match ? match[2] : null; } 

On the server in the form handler (OnBeforeIBlockElementAdd or custom handler):

$callibriUid = htmlspecialchars($_POST['callibri_uid'] ?? ''); if ($callibriUid) { $leadFields['UF_CALLIBRI_UID'] = $callibriUid; $visitData = (new \Local\Callibri\ApiClient())->getVisitByUid($callibriUid); if ($visitData) { $leadFields['UF_UTM_SOURCE'] = $visitData['utm_source'] ?? ''; $leadFields['UF_UTM_CAMPAIGN'] = $visitData['utm_campaign'] ?? ''; } } 

What does lead deduplication bring?

A typical issue: a client calls and then fills a form. Two separate leads for one contact. We solve this by checking the phone number: if a lead with status NEW and the same phone exists within the last 24 hours, we update its UTM fields instead of creating a new one. This approach reduces duplicates by 90%. Without deduplication, the sales team wastes time on manual merging, and ad reports overestimate cost per lead by 2x.

Common integration mistakes

  • Missing webhook secret token—returns 403.
  • The callibri_visitor_uid cookie is not set immediately—need a delay before processing the form.
  • Custom fields not created—lead created without UTM.

Custom fields for UTM in CRM

Fields can be created via CUserTypeEntity or through the CRM admin interface. Recommended set:

Field code Type Purpose
UF_CALLIBRI_ID string Call/chat ID in Callibri
UF_CALLIBRI_UID string Visitor UID for form stitching
UF_UTM_SOURCE string utm_source
UF_UTM_MEDIUM string utm_medium
UF_UTM_CAMPAIGN string utm_campaign
UF_UTM_TERM string utm_term
UF_CALL_DURATION integer Call duration, sec
UF_IS_TARGET_CALL boolean Target call

Comparison of integration methods

Criterion Webhook (calls) REST API (forms)
Data type Calls, chats Visits, history
Initiation Callibri → your server Your server → Callibri
Latency Instant 1–5 seconds
Requires JS No Yes (for uid)

Step-by-step integration setup

  1. Register a webhook in the Callibri admin panel.
  2. Place the endpoint handler on the Bitrix server.
  3. Create required custom fields via admin interface or API.
  4. Configure JavaScript on pages with forms to pass callibri_visitor_uid.
  5. Implement deduplication logic based on phone number.
  6. Perform end-to-end testing: call → lead with UTM.

What's included in the work

  • Integration documentation and data schema.
  • Access to Git repository with handler code.
  • Training for managers on working with UTM fields in CRM.
  • Technical support for 2 weeks after launch.

Our team has 7+ years of experience in Bitrix and Callibri integrations, completed over 50 projects. Average basic integration time is 2 weeks, full stitching with forms, deduplication, and UTM dashboard is 3–4 weeks. Contact our engineers for a consultation—they will help set up end-to-end analytics for your business. Request a demo of a working integration to evaluate functionality before signing a contract.

For detailed API study: Callibri REST API.