Bitrix24 Integration with CoMagic
Your company spends budget across five advertising channels. Managers handle calls and leads, but in your CRM all leads look the same — no source attribution. The marketer counts conversions from ad clicks, and sales counts closed deals in Bitrix24. There's a gap between these numbers. CoMagic (UIS) closes it: call tracking, chat analytics, multi-touch attribution, and CRM data transmission with keyword-level precision.
This integration differs from basic UIS telephony setup. Telephony is call routing, SIP trunk, softphone. Here we're talking about the analytics side: where the client came from, which ad channel worked, how many touchpoints before the deal.
What CoMagic Tracks
CoMagic operates at the visitor session level. A site script assigns each visit a unique identifier and collects:
- Traffic source — advertising channel, referrer, direct visit
- UTM tags — source, medium, campaign, content, term
- Keyword — from Yandex Direct and Google Ads
- Landing page and request page
- Request type — call, chat, form, callback
CoMagic substitutes phone numbers on your site (dynamic call tracking) and tracks chats via its own widget. Each request is tied to a session with full attribution.
Sending Data to Bitrix24
Data from CoMagic reaches your CRM two ways: via native connector and via Data API.
Native connector is enabled in the CoMagic dashboard: Integrations → Bitrix24. It works in "one call = one lead" mode. On incoming call, CoMagic sends data to Bitrix24 — a lead is created with UTM fields. Limitations: no field mapping flexibility, no chat handling.
Data API — CoMagic's REST interface for exporting analytics data. Main methods:
-
get /calls/report— call report with attribution -
get /chats/report— chat report -
get /goals/report— goal report (forms, callbacks) -
get /visitors/report— visitor session data
Data API enables full two-way integration.
Custom Integration Architecture
For maximum analytics precision, use Data API + Bitrix24 REST API:
-
Calls. Cron job polls
/calls/reportevery 5 minutes. For each new call:- Search for contact:
crm.contact.listby phone number. - Contact found → register call:
telephony.externalcall.registerbound to contact. UTM and source are recorded in notes or custom fields. - Contact not found → create lead:
crm.lead.addwithUTM_SOURCE,UTM_MEDIUM,UTM_CAMPAIGNand custom fields. - Attach recording:
telephony.externalcall.attachRecord.
- Search for contact:
-
Chats. Requests from CoMagic's chat widget are transmitted similarly.
/chats/reportreturns chat text, source, UTM tags. In Bitrix24, a lead is created or activity is logged in the timeline of an existing contact. -
Forms and callbacks.
/goals/reportcontains data on completed forms and callback requests. Each goal = lead in CRM.
Custom fields for CoMagic data:
-
UF_CRM_CM_SOURCE(string) — source name -
UF_CRM_CM_KEYWORD(string) — keyword -
UF_CRM_CM_CHANNEL(string) — advertising channel -
UF_CRM_CM_SESSION_ID(string) — CoMagic session ID
Lead Scoring and Multi-Touch Attribution
CoMagic rates request quality: call duration, whether a conversation occurred (not a drop), repeat contact. This data is used for lead scoring in your CRM.
Scheme:
- Call under 15 seconds → low-priority lead.
- First call over 2 minutes → high priority. A robot in Bitrix24 auto-assigns responsible manager.
- Repeat call from existing contact → no new lead created, activity is updated.
Multi-touch attribution shows all customer touchpoints before the request. CoMagic records: first visit from Direct → second visit from organic → call after email campaign click. In Bitrix24, this chain is recorded in lead notes or a custom field — the marketer sees the customer's full path.
Syncing Deal Data Back to CoMagic
For ROI calculation in CoMagic, revenue data from your CRM is needed. When a deal closes, the onCrmDealUpdate webhook sends to CoMagic:
- Session ID (
UF_CRM_CM_SESSION_ID) - Deal amount
- Status (won / lost)
CoMagic links revenue to the advertising source and calculates ROI by channel, campaign, and keyword.
Implementation Timeline
| Scale | What's Included | Timeline |
|---|---|---|
| Basic | Native connector, leads from calls, UTM tags in CRM | 2-3 days |
| Standard | Data API, calls + chats + forms, custom fields, scoring | 1-2 weeks |
| Extended | Multi-touch attribution, deal data sync back, custom reports, training | 2-3 weeks |
What We Configure
- Connect CoMagic to Bitrix24 via native connector or Data API
- Create custom fields in CRM for CoMagic analytics data
- Develop sync script: cron job, call handling, chat handling, form handling
- Deduplication logic: contact search by number, repeat request handling
- Attach call recordings to CRM records
- Set up lead scoring: prioritize by call duration and request type
- Send closed deal data back to CoMagic for ROI calculation
- Test full chain: visit → request (call/chat/form) → lead → deal → ROI in CoMagic
- Train marketer: source reports, multi-touch attribution, data interpretation







