Loading...
Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

There are two ways of transfer of leads to CRM: 

  • In the first case, data is transferred from a website to CRM and then is uploaded to Roistat. Read more at Upload of leads to CRM
  • In the second case, data is transferred to Roistat and then is sent to CRM. This way has the following advantages:
    • It provides the backup of information about the leads in Roistat. 
    • It allows quickly to change the configuration of transfer of leads to CRM.  

Configuration

To start the configuration, integrate your CRM with Roistat (read the integration manual for your CRM).

The transfer of leads to CRM can be configured in two ways:

  1. In Roistat interface (the easiest way).   
  2. With the help of PHP-code (this way is the most flexible in configuration).

How to configure the transfer of leads to CRM using the Roistat interface

(warning) This way is unavailable if the code of the form is placed between <iframe></iframe> tags.

  1. Open the Settings of your Roistat project and choose the Leads from the website forms tab.  
  2. Click the Add form button.   
    You will see the New form window.
  3. In the Name field, specify the name of the form that will be sent to the lead's title. Leads created through this form will be called Lead from the Form name form
  4. Specify the mechanism of sending the data on the lead:

    • Form. Use this mechanism if the leads' forms in the source code of your website are tagged by < form > tag, form fields are tagged by < input > tag, and data is sent by reloading the webpage or by pressing the button with type="submit" type.
    • Button. Use this mechanism if the data from the lead's form is sent with the help of AJAX by clicking any type of button. 
  5. After choosing the mechanism of sending the data on the lead, specify For selector or Button selector
    • Form selector is a CSS-selector that verifies the website form, from which Roistat receives the data for forming the lead. No matter how many selectors you specify, one or several, but It is important that these selectors verify the needed form. To specify the selectors, use CSS-notation, for example class selector .registration-form-1 (<form class=“registration-form-1”>), identifier selector #contact-form-1 (<form id=“contact-form-1”>).  
    • Button selector is a CSS-selector that verifies the website button, by clicking on which Roistat receives the data for forming the lead. No matter how many selectors you specify, one or several, but It is important that these selectors verify the needed form. To specify the selectors, use CSS-notation, for example class selector .bnt-primary (<button class=“bnt-primary”>).   

       How to get the CSS-selector of form or button
      1. Open the order form on your website. Usually, it is called Shopping cart. If the data of the order is entered directly on your website page, open the page where you can create the order. 
      2. Open the source code of the order form or order page. You can do it with the help of your browser by selecting the content of the form or content of the order page and clicking the Source code of the selected fragment button. 
      3. Search by the keyword form id or form, if you want to get the CSS-selector of form or search by the name of the button from which the order is sent if you want to get the CSS-selector of button. 
      4. Copy the identifier value (id) or class value (class):
  6. Specify the way of filling the main fields of the form in CRM:
    Static value:

    In this case, the value entered in the right field is transferred to the lead in CRM without any changes. Click here to see the list of variables you can use to fill the main fields. 

    Value from the form field:

    In this case, the value entered in the form field on the website is transferred to the lead in CRM. For example, if you see <input type="text" name="Phone"...> in the code of the form on your website, you must enter Phone in the phone field. can specify the value of the name attribute by Укажите значение атрибута nameдля поля формы на сайте. 

    Result of JS execution:

    In this case, the value received with the help of JS-code is transferred to the lead in CRM. For example, value return $("input[name='email']").val() is transferred to Email field.

  7. If needed, create additional fields of the lead:
    (информация) You can't add the additional fields if integration with goals is configured in Roistat project. 
    1. Open the Additional fields block.
    2. Select the required field from the dropdown list. The list is uploaded from the integrated CRM.  
    3. Specify the way of filling the additional field (see paragraph 6 of this manual).
      (информация) If you need to transfer the empty value to the additional field of the lead, specify the Static value and press space bar. 
    4. Click the Add button. Добавить и повторите пункты b и c, если требуется больше одного дополнительного поля.
    You can use the Additional fields to specify the city in which the lead was created or to fill in the mandatory CRM field that is absent in the form. 
  8. Click the Save button. 

The information about the created form will appear in the Leads from the website form page. To edit or delete the form, use the buttons in the Actions section:

(информация) Changes will take effect within several minutes, as well as in the issuance of a new visit number. 

How to configure the transfer of leads to CRM via Roistat with the help of the code

Here's the example of PHP-code, that collects the data from lead's form and sends this data to Roistat. Use this code as a basis, edit it, and add it to the file that processes the forms on your website:

Code for configuring the transfer of leads to CRM via Roistat
<?php
// Данные должны быть в кодировке UTF-8! Иначе — это может привести к ошибке.
// Если вы используете кодировку Windows-1251, то можно преобразовать все переменные через $value = iconv("Windows-1251", "UTF-8", $value);
// или указать в доп. полях ключ 'charset' с используемой на сайте кодировкой, сервер Roistat, конвертирует все значения из указанной кодировки в UTF-8.
 
// ...
// Где-то здесь вызывается текущая функция создания сделки, например, функция mail().
// ...
 
$roistatData = array(
    'roistat' => isset($_COOKIE['roistat_visit']) ? $_COOKIE['roistat_visit'] : 'nocookie',
    'key'     => '', // Ключ для интеграции с CRM, указывается в настройках интеграции с CRM.
    'title'   => '', // Название сделки
    'comment' => '', // Комментарий к сделке
    'name'    => '', // Имя клиента
    'email'   => '', // Email клиента
    'phone'   => '', // Номер телефона клиента
	'order_creation_method' => '', // Способ создания сделки (необязательный параметр). Укажите то значение, которое затем должно отображаться в аналитике в группировке "Способ создания заявки"
	'is_need_callback' => '0', // После создания в Roistat заявки, Roistat инициирует обратный звонок на номер клиента, если значение параметра равно 1 и в Ловце лидов включен индикатор обратного звонка. 
	'callback_phone' => '<Номер для переопределения>', // Переопределяет номер, указанный в настройках обратного звонка.
    'sync'    => '0', //  
    'is_need_check_order_in_processing' => '1', // Включение проверки заявок на дубли
	'is_need_check_order_in_processing_append' => '1', // Если создана дублирующая заявка, в нее будет добавлен комментарий об этом
	'fields'  => array(
	// Массив дополнительных полей. Если дополнительные поля не нужны, оставьте массив пустым.
	// Примеры дополнительных полей смотрите в таблице ниже.
     "charset" => "Windows-1251", // Сервер преобразует значения полей из указанной кодировки в UTF-8.
    ),
);
 
file_get_contents("https://cloud.roistat.com/api/proxy/1.0/leads/add?" . http_build_query($roistatData));
?>


     


  • No labels