Articles on: Integrations

Capture CANDDi data direct to Salesforce (Web-to-Lead)

Salesforce Web-to-Lead is an excellent way to integrate capture enquiries from your website directly into CANDDi. (See here for Salesforce introduction) ((ADD LINK: https://help.salesforce.com/apex/HTViewHelpDoc?id=setting_up_web-to-lead.htm))

By adding this integration code into your Salesforce configuration and onto your website, your users can click directly from Salesforce to see the CANDDi profile.

These are the changes you need to make to Salesforce and your website:

Add a new field into Salesforce for all Leads. We recommend calling this something like CANDDi URL. You need to get the API Id for this field. See here for help ((ADD LINK https://help.salesforce.com/apex/HTViewHelpDoc?id=adding_fields.htm&language=nl))

Use the web-to-lead form creator to make your web-to-lead form. Remember to add the new field into this form so that you can insert data via the web-front-end. Then, get the default Web-to-lead code from Salesforce and paste into your website.

Find the field with the API Id this will name the following HTML: <input name="APIId" and add an additional attribute id="canddiprofile".

Add the following code into your website (underneath) the Web-to-lead form. NOTE: The strAccount should be your CANDDi Account slug - the first part of the https://[strAccount].canddi.com.

This code will query the CANDDi tracker to get the unique BrowserID:

<script>
 var intCanddiCount = 5;
 function Salesforce_saveBId(){
   if(0 > intCanddiCount) {
    return;
   }
   intCanddiCount--;
   if(!window.canddi || !window.canddi.getBId()) {
    window.setTimeout(Salesforce_saveBId, 1000);
    return;
   }
   var strAccount = "";
   document.getElementById("canddiprofile").value = "https://"+strAccount+".canddi.com/contact/BId/search/"+window.canddi.getBId();
  }
  Salesforce_saveBId();
</script>


Have more questions? Contact us at hello@canddi.com or 0161 414 1080

Updated on: 02/02/2020

Was this article helpful?

Share your feedback

Cancel

Thank you!