Streamline Lead Capture: Quiz Form to Bitrix24 Integration
Managers receive just a contact in CRM, while quiz responses (budget, timeline, preferences) end up in an unreadable comment or never reach the system. This delays lead qualification for hours and leaves ad channels without attribution. We solve this: we configure each quiz response to be passed into a separate custom field in Bitrix24, create leads with UTM tags and an automatic callback task. Integration is done turnkey with a 6-month warranty and 10+ years of Bitrix experience.
Why standard forms fall short – and how quizzes boost conversion
A typical three-field form gives the manager minimal information. Clients often skip the comment. A quiz structures the conversation with specific questions (budget, timeline, preferences) and captures selections. As a result, the CRM receives not just a contact, but a ready lead qualification. This cuts processing time by 60% (from 2 hours to 40 minutes on average), saving up to $200 per month in manager hours.
Integration approaches: comparison
| Approach | Complexity | Customization | Implementation time | Requires development |
|---|---|---|---|---|
| Webhook from quiz service -> middleware -> Bitrix24 | Medium | High (custom mapping) | 3–7 days | Yes (PHP handler) |
| Custom quiz on site -> REST API | High | Maximum | 1–2 weeks | Yes (frontend + backend) |
| Bitrix24 CRM form (multi-step) | Low | Low (design) | 1–2 hours | No |
Webhook integration is 3 times faster than custom development and offers the best price/quality ratio.
Step-by-step: How to integrate quiz with Bitrix24
- Choose a quiz service (e.g., Marquiz, Qform) and create your quiz.
- Set up a webhook in the quiz service to send data to your server's endpoint.
- Create custom fields in Bitrix24 for quiz answers (e.g., UF_BUDGET_RANGE, UF_URGENCY) and UTM tags.
- Develop a PHP handler that validates the webhook, maps answers to custom fields, and calls
crm.lead.addvia REST API. - Add an activity (call task) automatically for each new lead with a 2-hour deadline.
- Test the full flow: submit quiz, verify lead in CRM, check custom fields and activity.
Implementation details: webhook handler and lead creation
Webhook handler: Marquiz → Bitrix24
Marquiz sends a POST with a JSON payload when the quiz completes:
Example Marquiz payload
{
"quiz_id": "abc123",
"quiz_name": "Window selection",
"contact": {
"name": "Ivan",
"phone": "+79161234567",
"email": "[email protected]"
},
"answers": [
{"question": "Room type", "answer": "Apartment"},
{"question": "Number of windows", "answer": "3"},
{"question": "Urgency", "answer": "Within a month"},
{"question": "Budget", "answer": "Individually"}
],
"result": "Standard package",
"utm": {
"utm_source": "yandex",
"utm_campaign": "windows_brand"
}
}
The handler on your server:
// /local/api/quiz-webhook.php
require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');
header('Content-Type: application/json');
$payload = json_decode(file_get_contents('php://input'), true);
// Verification using secret token in header
$token = $_SERVER['HTTP_X_QUIZ_TOKEN'] ?? '';
$secret = \Bitrix\Main\Config\Option::get('local.quiz', 'webhook_secret_marquiz');
if (!hash_equals($secret, $token)) {
http_response_code(403);
exit(json_encode(['error' => 'Unauthorized']));
}
$integrator = new \Local\Quiz\Bx24Integrator();
$result = $integrator->createLeadFromQuiz($payload);
echo json_encode(['success' => true, 'lead_id' => $result]);
Creating a lead in Bitrix24 via REST
namespace Local\Quiz;
use Local\Bx24\RestClient;
class Bx24Integrator
{
private RestClient $bx24;
public function __construct()
{
$webhookUrl = \Bitrix\Main\Config\Option::get('local.quiz', 'bx24_webhook_url');
$this->bx24 = new RestClient($webhookUrl);
}
public function createLeadFromQuiz(array $data): int
{
$contact = $data['contact'] ?? [];
$answers = $data['answers'] ?? [];
$comments = $this->buildQuizComment($data['quiz_name'] ?? '', $answers, $data['result'] ?? '');
$leadFields = [
'TITLE' => ($data['quiz_name'] ?? 'Quiz') . ': ' . ($contact['phone'] ?? ''),
'NAME' => $contact['name'] ?? '',
'PHONE' => [['VALUE' => $contact['phone'] ?? '', 'VALUE_TYPE' => 'WORK']],
'EMAIL' => [['VALUE' => $contact['email'] ?? '', 'VALUE_TYPE' => 'WORK']],
'SOURCE_ID' => 'WEB',
'STATUS_ID' => 'NEW',
'COMMENTS' => $comments,
'UF_QUIZ_ID' => $data['quiz_id'] ?? '',
'UF_QUIZ_RESULT' => $data['result'] ?? '',
'UF_UTM_SOURCE' => $data['utm']['utm_source'] ?? '',
'UF_UTM_CAMPAIGN'=> $data['utm']['utm_campaign'] ?? '',
];
$leadFields = $this->mapAnswersToFields($leadFields, $answers);
$result = $this->bx24->call('crm.lead.add', ['fields' => $leadFields]);
$leadId = (int)($result['result'] ?? 0);
if ($leadId) {
$this->bx24->call('crm.activity.add', [
'fields' => [
'TYPE_ID' => 2,
'SUBJECT' => 'Call back on quiz: ' . ($contact['phone'] ?? ''),
'OWNER_TYPE_ID' => 1,
'OWNER_ID' => $leadId,
'DEADLINE' => date('c', strtotime('+2 hours')),
],
]);
}
return $leadId;
}
private function buildQuizComment(string $quizName, array $answers, string $result): string
{
$lines = ["=== Quiz: {$quizName} ==="];
foreach ($answers as $answer) {
$lines[] = ($answer['question'] ?? '?') . ': ' . ($answer['answer'] ?? '—');
}
if ($result) {
$lines[] = '';
$lines[] = "Quiz result: {$result}";
}
return implode("\n", $lines);
}
private function mapAnswersToFields(array $fields, array $answers): array
{
$mapping = [
'Number of windows' => 'UF_WINDOWS_COUNT',
'Room type' => 'UF_ROOM_TYPE',
'Budget' => 'UF_BUDGET_RANGE',
'Urgency' => 'UF_URGENCY',
];
foreach ($answers as $answer) {
$question = $answer['question'] ?? '';
$fieldCode = $mapping[$question] ?? null;
if ($fieldCode) {
$fields[$fieldCode] = $answer['answer'] ?? '';
}
}
return $fields;
}
}
Custom fields and mapping
Custom fields in Bitrix24 for the quiz
Fields are created via REST API or in the Bitrix24 interface:
$this->bx24->call('crm.userfield.add', [
'fields' => [
'ENTITY_ID' => 'CRM_LEAD',
'FIELD_NAME' => 'UF_QUIZ_RESULT',
'USER_TYPE_ID'=> 'string',
'XML_ID' => 'QUIZ_RESULT',
'EDIT_FORM_LABEL' => ['ru' => 'Quiz result'],
'LIST_COLUMN_LABEL' => ['ru' => 'Quiz result'],
'MANDATORY' => 'N',
],
]);
Mapping quiz questions to custom fields
| Quiz question | CRM field | Type |
|---|---|---|
| Budget | UF_BUDGET_RANGE |
string |
| Room type | UF_ROOM_TYPE |
string |
| Urgency | UF_URGENCY |
string |
| Number of windows | UF_WINDOWS_COUNT |
integer |
Bitrix24 CRM form integration (alternative)
If building a quiz from scratch, use Bitrix24 CRM form with hidden fields. The last step sends data directly to the CRM form endpoint. Ensure the form ID is correct and test thoroughly.
What's included in the integration (deliverables)
- Detailed documentation of the integration (webhook endpoints, field mappings, code comments)
- Setup of custom fields in Bitrix24 for quiz answers and UTM tags
- Development and deployment of the webhook handler (PHP) to your server
- Creation of automatic activity (call task) for each new lead
- Testing of the full flow: quiz submission → lead creation → activity creation
- Handover of access (admin panel, webhook secret tokens) and a 30-minute training session
- 6-month warranty on the integration
Best practices and common mistakes
Why passing UTM tags matters
Without UTM tags, you cannot know which channel brought the target client. We pass utm_source and utm_campaign into separate fields, enabling ad campaign reports inside CRM. Common mistakes to avoid:
- No webhook verification – anyone can send fake leads.
- Mapping to comments only – answers get lost.
- Ignoring UTM tags – lost attribution.
- No automatic task – leads stagnate.
We avoid these in every project.
How quiz form integration speeds up lead processing
With manual processing, the manager spends time on callbacks and clarifying needs. With integration, all answers are already in the lead card: budget, urgency, property type — as separate fields. The manager can immediately decide whether to call urgently or send a commercial offer. Adding an automatic task activity "Call back in 2 hours" reduces lead loss by 60% (based on our project data).
Pricing and about us
- Basic webhook (one quiz, 3 fields, no UTM) – from $500, 3-7 days.
- Full setup (custom fields, activity, UTM, multiple quizzes) – $1,200–$2,500, 1-2 weeks.
Contact us for a project estimate — we'll send a commercial proposal within a day. Order the integration and get a ready-made solution with a 6-month warranty.
We have 10+ years of experience with Bitrix24 and have completed over 50 integration projects. Our team specializes in CRM automation and custom development. We provide full support and maintenance after launch.







