Web Site Connector

<< Click to Display Table of Contents >>

Navigation:  Setup >

Web Site Connector

Often you want a lead generating form on your website to be able to create leads directly into the CRM system. This is done by adding code into the website (typically php and Wordpress), so that - at the visitor registration - data is sent to the lead entity in your ChannelCRM.

 

Below is an example that uses php and php-curl library.

 

$loginCRM = 'brugerid';

$passwordCRM = 'password';

$urlCRM = 'https://dinchannelcrmsite.onchannelcrm.com/crm/ChannelCRMData.svc/Leads';

 

$leadCompanyName = $companyName;

$leadName = $name;

$leadMail = $email;

$leadTelefon = $telefon;

$leadNotes = "Firmaets størrelse: ".$hovederhverv."\r\nHovederhverv: ".$businessType;

$ch = curl_init();

 

$dataCRM = array("contactname" => $leadName, "contactmail" => $leadMail, "companyname" => $leadCompanyName, "contactphone" => $leadTelefon, "notes" => $leadNotes, "closed" => "false");                                                                    

$json_stringCRM = json_encode($dataCRM);     

 

curl_setopt($ch, CURLOPT_URL, $urlCRM);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

curl_setopt($ch, CURLOPT_POSTFIELDS, $json_stringCRM);

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));                                                                                                                

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_USERPWD, $loginCRM.":".$passwordCRM);

 

$server_output = curl_exec ($ch);

curl_close ($ch);

 

In the example the fields contactname, contactmail, companyname, contactphone and notes are used.

 

In total you have the following fields to choose from:

 

[contactname]

Full name of the contact

[contactmail]

Mail address

[contactphone]

Phone numer on form xxxxxxxx or +xxx xxxxxxxx

[contacttitle]

Job-title of the contact

[companyname]

Company Name

[companystreet]

Street Address

[companyzip]

Zip

[companycity]

City

[companystate]

State

[companycountry]

Country Code in ISO-3 form. (Denmark = DNK)

[companyvat]

Company VAT

[companyean]

Company EAN

[notes]

Notes max 4.000 characters

[infotags]

Semicolon separated list of Infotags to add to the contact created by the lead conversion.



 

None of the fields are mandatory. But if the lead are to be of any value, it is best to have [contactname] and [contactmail] as a minimum. And to be linked to a company, it is very advantageous if [companyvat] (CVR number) is there as well.