Integration of 1C-Bitrix with cross-analytics services
The advertising budget is being spent, requests are coming in, but how many of them resulted in sales — nobody knows. Yandex.Metrica shows conversions on the site, CRM stores deals, 1C records payments — but there's no connection between them. Cross-analytics closes the gap: ad click → website request → CRM deal → 1C payment. For Bitrix, this is a task of integrating multiple systems, and integration points are where everything breaks down.
Data transmission architecture
Cross-analytics is built on user identification at all stages of the funnel. The technical chain:
-
Advertising system (Yandex.Direct, Google Ads) — assigns
yclid/gclidon click - Site on Bitrix — saves the tag in a cookie and passes it to a request form or order
- CRM / analytics service — receives the request with a tag, links it to the advertising source
- 1C — records payment, data is returned to the analytics service for ROI calculation
Main services: Roistat, Calltouch, CoMagic (UIS), Callibri. Each has its own JS tracker for the site and API for transmitting offline conversion data.
Installing tracker on Bitrix
The tracker is a JS script that collects visit data: traffic source, UTM tags, yclid/gclid, viewed pages, time on site. The script is installed via header.php template or via the insertion management module (Settings → Product Settings → Authorization → Insertions).
For Roistat, the script creates a roistat_visit cookie with a visit number. This number is the key to the entire integration: it must be included in the Bitrix order and then in CRM.
Passing visit number to order. Two options:
-
Order property. Create an order property of type "String" (
sale.order.property) with codeROISTAT_VISIT. When placing an order, the frontend script reads the cookie and puts the value in a hidden form field. On the backend —OnSaleOrderBeforeSavedhandler, which copies the value to the order property. -
UTM properties. Bitrix can save UTM tags through the
salemodule (settings → order properties → UTM auto-fill). The analytics visit number is passed as an additional UTM tag.
Integration with Bitrix24 CRM
If CRM is Bitrix24, lead and deal data is transmitted via REST API. Analytics services (Roistat, Calltouch) have ready-made integrations: in settings you specify the B24 portal URL and token. The service:
- Retrieves leads/deals via
crm.lead.list/crm.deal.list - Matches by phone number, email, or visit number (if passed in a UF field)
- Gets deal statuses for conversion rate calculation by stages
For boxed Bitrix with the crm module (not B24), there are no ready-made integrations — a custom handler is written that sends order data to the analytics service API.
Passing offline conversions from 1C
Payment in 1C is the final point of the funnel. For the analytics service to know that an ad click led to real money, you need to transmit payment data back.
Scheme:
- Order in Bitrix contains the analytics visit number (property
ROISTAT_VISIT) - When exchanging with 1C, the visit number is passed as a document requisite (added to CommerceML mapping or REST)
- When payment is processed in 1C — a handler sends a POST request to the analytics service API:
POST /api/push-offline-saleswith data{visit_id, revenue, order_id, date}
For Roistat the API method is — POST https://cloud.roistat.com/api/v1/project/add-orders. For Calltouch — POST /api/calls-service/RestAPI/orders/upload.
Alternative to direct 1C integration — an intermediate webhook: Bitrix catches the OnSalePayOrder event, requests the payment status from 1C via REST API, and sends it to the analytics service. This is simpler if 1C doesn't have a developer.
Phone number substitution (call tracking)
Calltouch and CoMagic substitute the phone number on the site — each visitor sees a unique number, calls to which are linked to the visit. For Bitrix, this works via a JS tracker that replaces the number in the DOM.
Pitfalls:
- Composite cache. The HTML page is cached, the JS tracker replaces the number after loading. If the number is inserted as text in the template — substitution will work. If the number is an image or SVG — no.
-
Component cache. The phone number in the
bitrix:main.includecomponent is cached — the tracker should search for the number by CSS class or data attribute, not by text. -
Mobile app. If the site is wrapped in a PWA via the
mobileappmodule — the tracker may not load.
Timeline and scope
| Stage | Work | Duration |
|---|---|---|
| Tracker installation + pass visit to order | JS, order property, handler | 2–3 days |
| CRM integration (B24) | Configure ready connector, field mapping | 1–2 days |
| Passing offline conversions from 1C | Exchange enhancement, API handler | 3–5 days |
| Call tracking + testing | Phone substitution, composite cache testing | 1–2 days |
Cross-analytics on Bitrix is not "install a script". It's a chain of four or five systems where losing the visit identifier at any stage nullifies the entire effort. It's critical to test the full path: from ad click to payment reflection in the analytics dashboard.







