Setting up Dynamic Call Tracking on 1C-Bitrix

Setting up Dynamic Call Tracking on 1C-Bitrix We have faced a situation: a client spends 500,000 ₽ on advertising, sees 1000 leads in CRM, but does not know which channel brought the call. Without dynamic call tracking, this part of conversion remains a blind spot. For ecommerce and services, cal

Our competencies:

Frequently Asked Questions

Setting up Dynamic Call Tracking on 1C-Bitrix

We have faced a situation: a client spends 500,000 ₽ on advertising, sees 1000 leads in CRM, but does not know which channel brought the call. Without dynamic call tracking, this part of conversion remains a blind spot. For ecommerce and services, calls account for 40–60% of requests — ignoring them is impossible. We have learned to configure call tracking on 1C-Bitrix so that every call lands in analytics with UTM tags, keyword, and source.

The principle: each visitor sees a unique substitute number from a pool. The system matches the number to the session and sends data to analytics systems. After the call, the number returns to the pool. Substitution accuracy reaches 99.9% with proper setup.

Choosing a Provider and Installing the Script

Major providers: Callibri, CoMagic, Roistat, Ringostat, Mango Office. All offer a JS script and API. For Bitrix, we add the script via Bitrix\Main\Page\Asset::addString in the OnEpilog event — this ensures the script is not cached and does not duplicate during AJAX navigation.

// /local/php_interface/init.php \Bitrix\Main\EventManager::getInstance()->addEventHandler( 'main', 'OnEpilog', function () { if (\Bitrix\Main\Application::getInstance()->getContext()->getRequest()->isAdminSection()) { return; } $asset = \Bitrix\Main\Page\Asset::getInstance(); $asset->addString( '<script type="text/javascript"> (function(w,d,n,t){ // Provider call tracking script code w[n] = w[n] || function(){(w[n].q=w[n].q||[]).push(arguments)}; t = d.createElement("script"); t.async = 1; t.src = "https://tracker.callibri.ru/callibri.js"; d.head.appendChild(t); })(window,document,"callibri"); callibri("setCounter", "YOUR_COUNTER_ID"); </script>', true ); } ); 

How to Properly Mark Up Phones on a Bitrix Site?

For correct substitution, the phone must be marked with data attributes. In the component template (e.g., header.php), change the output:

<!-- Instead of --> <span class="phone">+7 (495) 123-45-67</span> <!-- Use --> <span class="calltracking-phone" data-original-phone="+74951234567" data-phone-display="+7 (495) 123-45-67"> +7 (495) 123-45-67 </span> 

The provider script finds elements by CSS selector and replaces the content. If the site has multiple phones (main, sales, service), each gets a separate substitution group in the provider dashboard.

Why Is the Pool Size Important?

The pool must cover the maximum number of concurrent visitors. For example, with 30 concurrent visitors and an average session of 4 minutes, at least 30 numbers are needed. An insufficient pool causes new visitors to see a static number — data is lost. A pool of 50 numbers costs about 7,500 ₽ per month — that is the price for accuracy. Thanks to precise attribution, you stop wasting up to 40% of your advertising budget on non-target calls.

For Bitrix sites with caching, there is a nuance: if the page is cached at the Composite site or nginx level, the call tracking script may load with a delay. The solution — keep a fallback phone in HTML, while substitution is performed via JS after full page load.

A typical mistake: the script does not work on cached pages. If the script is added in the header without disabling cache, it does not execute on composite pages. Use the OnEpilog event and set the cache disable flag via $asset->getKernelInfo()->set($asset::KERNEL) — then the script will load dynamically even on cached pages.

Sending Calls to Google Analytics 4 and Yandex.Metrica

Providers can send call events to GA4 and Metrica. For GA4, use events phone_call_start and phone_call_end with parameters call_id, utm_source, duration, is_target. Integration is done via provider settings or custom code:

callibri('onCallStart', function(callData) { gtag('event', 'phone_call_start', { 'call_id' : callData.callId, 'utm_source' : callData.utmSource, 'utm_campaign': callData.utmCampaign, }); }); callibri('onCallEnd', function(callData) { gtag('event', 'phone_call_end', { 'call_id' : callData.callId, 'duration' : callData.duration, 'is_target': callData.isTarget, }); }); 

Comparison: Dynamic vs Static Call Tracking

Characteristic Dynamic Call Tracking Static Call Tracking
Attribution accuracy Per visit Per channel
Number of numbers needed Equals concurrent visitors Equals number of channels
Cost (example) from 7,500 ₽/mo for 50 numbers from 500 ₽/mo for 5 numbers
Effectiveness for high traffic High (3x–5x more accurate) Low
CRM integration Full (each call in deal) Partial (only channel)

Dynamic call tracking is 3–5 times more accurate than static for high-traffic sites. Static assigns one number to a channel — if 100 people come via that channel and one calls, you cannot know who exactly. Dynamic tracks each visitor, linking the call to a specific visit and its UTM tags.

What's Included in the Work? (Deliverables)

Stage What We Do Result
Analytics Audit of current phone structure, provider selection, pool calculation Substitution scheme, technical specification
Script installation Embedding script via OnEpilog, event configuration Script on all pages, no duplicates
Phone markup Editing component templates (header, product card, contacts) All phones marked with data attributes
Substitution group setup Creating groups for different departments in provider dashboard Correct substitution for each line
Analytics integration Configuring GA4, Yandex.Metrica, CRM events (optional) End-to-end call analytics
Testing Verification of substitution for all channels (utm, direct, cache) Test protocol

How to Set Up Call Tracking on Bitrix: Step-by-Step Guide

  1. Audit the current site: Identify where phones are displayed and how they are marked. Ensure no CSP blocking.
  2. Choose a provider: Compare conditions of Callibri, CoMagic, Roistat. Start with a trial period.
  3. Register and obtain script: Register with the provider, get the JS script and counter ID.
  4. Install the script on the site: Add the code via OnEpilog in /local/php_interface/init.php as shown above.
  5. Mark up phones: Mark each phone with data-original-phone and data-phone-display attributes.
  6. Configure the pool: In the provider dashboard, set the number count that covers peak traffic.
  7. Integrate with analytics: Configure event transmission to GA4 and Yandex.Metrica.
  8. Testing: Verify substitution for different UTM, direct visits, cached pages.

Checklist After Setup

  • Open the site with UTM tags ?utm_source=yandex&utm_medium=cpc — the phone should change.
  • Open without UTM (direct visit) — the default pool number is displayed.
  • Check cached pages: after cache warm-up, the phone still gets substituted.
  • Ensure phones in og:image and Schema.org are static, not substituted.
  • Check mobile version — click-to-call leads to the substituted number.

Contact us for an audit of your project — we will assess your current scheme in one day. Order call tracking setup — first call free. Our experience: over 50 projects on Bitrix, we guarantee every call will be attributed to its source.

According to Callibri provider data, substitution accuracy reaches 99.9% with proper setup.