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

Description

(warning)Before configuring the integration, install the Roistat tracking code! 

Each page of your website that is visited by the customers should have the tracking code, that allows Roistat to get the data about the visitors. After that, the promo-coding will be available. The tracking code will install to the cookie the roistat_visit variable, that contains the visit ID.  

Then, configure the sending of leads to Salesforce by adding to them the roistat_visit cookie.

So, after creating the lead, the new deal with roistat_visit identified in an additional field roistat will be created in your CRM. If a manager receives an order by phone, he can ask a promo-code and enter this code in the field.

Step 1. Add and configure the additional fields in Salesforce

Add the additional field roistat, in which the number of visits will be saved, to the following entities: Opportunities and Leads.  

Add the additional field lead_id to Opportunities and Leads to understand from which lead the deal was created. 

All Leads in Salesforce are converted. Contacts, Companies, and Opportunities are created from Leads. To transfer the values of additional fields from converted Lead, bind the Opportunities and Leads entities to the roistat and lead_id fields. 

Add the fields to the Lead

  1. Log in to your Salesforce account and click the Object manager button in the upper left part of the page:


  2. Find the Lead label and open it:


 roistat field

3. In the Fields and relationships field, click the New button: 

4. Set the Text area data type and click the Next button:

5. Then, specify the following mandatory parameters:

  • Field Label - roistat;

  • Field Name - roistat.

Then, click the Next button. 

6. In the Establish field-level security section, do nothing and click the Next button.

7. In the Add to page layouts section, verify if the needed pages are added, and click the Save and New button.

8. The roistat field is displayed in the Fields and Relationships section: 

 lead_id field

9. In the Fields and relationships field, click the New button: 

 Set the Formula data type and click the Next button:

10. Then, specify the following mandatory parameters:

  • Field Label - lead_id;

  • Field Name - lead_id;

  • Formula Return Type - Text.

Then, click the Next button. 

11. In the Enter formula section, enter the id in the lead id (Text) = field and click the Next button: 

12. In the Establish field-level security section, do nothing and click the Next button.

13. In the Add to page layouts section, verify if the needed pages are added, and click the Save and New button.

14. The lead_id field is displayed in the Fields and Relationships section: 

Add the fields to the Opportunity 

1. Click the Object manager button in the upper left part of the page:


2. Open the Opportunity label:


 roistat field

The process of configuration of the roistat field for Opportunities is the same as the process of the configuration of the roistat field for Leads. See more here.

 lead_id field

The process of configuration of the lead_id field for Opportunities is the same as the process of the configuration of the roistat field for Leads. The only difference is that you have to specify lead_id instead of roistat. See more here.


Bind the Leads and Opportunities fields 

To transmit the additional fields values from Leads to Opportunities, bind the fields you created. 

1. Click the Object manager button in the upper left part of the page:

2. Find the Lead label and open it:

3. In the Fields and relationships field, click the Map Lead Fields button: 

4. Go to the Opportunity section, map the lead field roistat to opportunity field roistat, and lead field lead_id to opportunity field lead_id

Save changes by clicking the Save button. 

Step 2. Configure the integration in the Roistat account

1. Open the Integrations, find the Salesforse and click the Connect button: 

2. Authorize the application by logging to your Salesforce account.

3. Distribute the statuses of the deals by dragging them into the statuses groups and click the Continue button:

Read more about distributing the statuses in this article

4. Read the Instruction of lead creation settings and click the Next step button. 

5. On the Loading deals from CRM: advanced settings step you can: 

  1. Specify the parameters of deals filtration. Learn more in this article
  2. Specify the values of business indicators fields. Learn more in this article

You can also Use contacts as clients in Roistat by dragging the switcher to the right:

6. On the Sending deals to CRM: basic settings step, select the responsible managers from the dropdown list and click the Save button.  

7. On the Sending deals to CRM: task creation step, you can activate the creation of tasks when creating deals in CRM to make managers work with the incoming leads more effectively. 

After enabling this option, set the Time for tasks completion, Task type, and Task text:

Step 3. Configure the automatic transfer of leads to CRM

We recommend configuring the transfer of deals to CRM via Roistat. In this case, the deal will be firstly sent to Roistat, and then Roistat will send them to CRM. To learn more about the advantages of this way of leads transfer, read this article

If you already configured the transfer of leads using the code, you shall fill in the additional field roistat with the value of cookie roistat_visit.

You can receive the value of this cookie using this code: 

$roistatVisitId = array_key_exists('roistat_visit', $_COOKIE) ? $_COOKIE['roistat_visit'] : "unknown";

Verifying the performance

  1. Create the lead on the website.
  2. Open the Integration list in your project. 
  3. Find the Salesforce integration and click the Configure button. 
  4. Click the Sent leads button and find the lead you created.
  5. Check if the visit number is specified in the Promo code field.  
  6. Find the successful status of the lead () is in the Sent field.
  7. Find the new lead with the visit number in your CRM.
  • No labels