There are two ways of transfer of leads to CRM:
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:
This way is unavailable if the code of the form is placed between <iframe></iframe> tags.
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”>).
|
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.
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.
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:
<?php // All data must be in UTF-8. // If you use Windows-1251 encoding, you can convert all the variables using $value = iconv("Windows-1251", "UTF-8", $value); // or specify the 'charset' key in the additional fields with the encoding used on your website. Roistat server will convert all the values with specified encoding to UTF-8. // ... // Here you can call the current function for creating the deal, for example mail() function. // ... $roistatData = array( 'roistat' => isset($_COOKIE['roistat_visit']) ? $_COOKIE['roistat_visit'] : 'nocookie', 'key' => '', // Key for integration with CRM that is specified in the CRM integratiom settings. 'title' => '', // Name of the deal 'comment' => '', // Comment to the deal 'name' => '', // Name of the client 'email' => '', // Email of the client 'phone' => '', // Client's phone number 'order_creation_method' => '', // The way of deal creation (optional parameter). Specify the value that will be shown in "The way of deal creation" section of Analytics 'is_need_callback' => '0', // After creating the lead in Roistat, Roistat initiates a callback to the client's number if the value of this parameter is '1' and Lead hunter has activated callback indicator. 'callback_phone' => '<number for redefinition>', // Redefines the number specified in the callback settings. 'sync' => '0', // 'is_need_check_order_in_processing' => '1', // Activating the verification of incoming requests for duplicates 'is_need_check_order_in_processing_append' => '1', // If the duplicate is created, it will receive a comment 'fields' => array( // Array of additional fields. If you don't need to add the additional fields, leave this array empty. // See the examples of additional fields in the table below. "charset" => "Windows-1251", // Server converts the value of fields with the specified encoding to UTF-8. ), ); file_get_contents("https://cloud.roistat.com/api/proxy/1.0/leads/add?" . http_build_query($roistatData)); ?> |
<?php // Method adds the comment to the deal $roistatData = array( 'key' => '', // Key for integration with CRM that is specified in the CRM integration settings. 'id' => '', // Lead identifier that returns it after the creation of method /api/proxy/1.0/leads/add) 'title' => '', // Title of comment (optional) 'message' => '', // Comment to the deal ), ); file_get_contents("https://cloud.roistat.com/api/proxy/1.0/leads/messages/add?" . http_build_query($roistatData)); ?> |
By default, the value of the sync parameter is 0 ( 'sync' => '0'). In this case, transfer of leads works the following way:
Set the value of the sync parameter to 1 ( 'sync' => '1'), and transfer of leads will work the following way:
sync parameter is 1, the error message or ID of the lead will also be sent in response to the request of proxylead creation. If the value of the |
To configure the integration, you need to copy the value of the 'key' parameter (integration key) from the Integrations catalog. To enter the Integrations catalog, open the Integrations list and select your CRM integration: |
|
Переменная | Значение |
---|---|
{city} | Visitor's city |
{country} | Visitor's country |
{region} | Visitor's region |
{ip} | Visitor's IP |
{visit} | Visit number |
{firstVisit} | First visit number |
{referrer} | Referrer page |
{domain} | Webaite domain |
{landingPage} | Ladning page |
{source} | Source (marker) |
{orderCreationMethod} | Lead creation method (Calltracking, Lead hunter, etc) |
{utmSource} | The value of visitor's tag 'utm_source' |
{utmMedium} | The value of visitor's tag 'utm_medium' |
{utmCampaign} | The value of visitor's tag 'utm_campaign' |
{utmTerm} | The value of visitor's tag 'utm_term' |
{utmContent} | The value of visitor's tag 'utm_content' |
{callee} | Dialed number (if leads are created by calltracking) |
{caller} | Client's phone number (if leads are created by calltracking) |
{roistatParam1} | The value of visitor's tag 'roistat_param1' |
{roistatParam2} | The value of visitor's tag 'roistat_param2' |
{roistatParam3} | The value of visitor's tag 'roistat_param3' |
{roistatParam4} | The value of visitor's tag 'roistat_param4' |
{roistatParam5} | The value of visitor's tag 'roistat_param5' |
{googleClientId} | ClientId value from Google Analytics |
{sourceLevel1} | The value of level 1 source (marker) |
{sourceLevel2} | The value of level 2 source (marker) |
{sourceLevel3} | The value of level 3 source (marker) |
{sourceLevel4} | The value of level 4 source (marker) |
{sourceLevel5} | The value of level 5 source (marker) |
{sourceLevel6} | The value of level 6 source (marker) |
{sourceLevel7} | The value of level 7 source (marker) |
{sourceAliasLevel1} | Readable title of level 1 source (marker) |
{sourceAliasLevel2} | Readable title of level 2 source (marker) |
{sourceAliasLevel3} | Readable title of level 3 source (marker) |
{sourceAliasLevel4} | Readable title of level 4 source (marker) |
{sourceAliasLevel5} | Readable title of level 5 source (marker) |
{sourceAliasLevel6} | Readable title of level 6 source (marker) |
{sourceAliasLevel7} | Readable title of level 7 source (marker) |
$roistatData = array( 'title' => 'New deal {visit}', 'name' => 'Client's name {visit}', 'comment' => 'utm_source: {utmSource}, utm_medium: {utmMedium}, utm_campaign: {utmCampaign}', 'fields' => array( '1276733' => '{city}', // Save the visitor's city in the additional field 'tags' => 'Тег1, {utmSource}, {utmMedium}, {utmCampaign}', // Save the value of UTM-tags in tags ), ); |
If CRM does not send the approve of lead creation, you will see the
icon in the Sent field of Sent leads list. After that, Roistat will attempt to send this lead every 30 minutes for 2 days. After receiving the approve from CRM, you will see the
icon in the Sent field, and the number of the deal will be shown in the Deal field.
Every 2 hours Roistat will attempt to send the unsent leads created within the last 48 hours.