V2: Web-to-Prospect - V2

Web-to-Prospect is an easy way to include a form on your website, which creates new prospects in Propertybase in real time.

Getting started

To get Web-to-Prospect enabled for your org, please send a message to support@propertybase.com. Our support staff will take care of the activation and will give you any additional information needed to start the, e.g. the endpoint Url for the Web-to-prospect.

Note: Web-to-Prospect is currently not available during a trial period.

Technical Documentation

Use a simple HTML Form to create a Prospect from within your website:
  1. Copy the example from the bottom of this page to a texteditor
  2. Skip the <head> part including the 'text/javascript' section. We will cover this later.

    <html>
    <head>
    <title>Lead Capture Form</title>
    <script type="text/javascript">
    function checkSubmit() {
    [...]
    </head>
  3. Enter your Propertybase WebToProspect Endpoint here:

    <body>
    <h1>Contact</h1>

    <form name="web2prospect" onsubmit="return checkSubmit();" method="get" action="ENTER_YOUR_ENDPOINT_HERE">
  4. You can specify a LeadSource, success page and a fail page in hidden fields. For the pages, please specify fully qualified URLs. We will forward your client to one of these pages, depending on the success of your request.

    For debugging purposes, you can also specify a parameter 'return_error'. If you set its value to 'true', Propertybase will return a technical error message if there are any issues with your data.

    <input type="hidden" name="PersonLeadSource" value="Web" />
    <input type="hidden" name="success_page" value="http://ENTER_YOUR_WEBSITE_URL_HERE/lead_success.html" />
    <input type="hidden" name="fail_page" value="http://ENTER_YOUR_WEBSITE_URL_HERE/lead_fail.php" />
    <input type="hidden" name="return_error" value="true" />
  5. Specify all fields you would like to track. The name of your input field has to match the Propertybase API fieldname. To get a short documentation on how to identify the API name, please click here.

    IMPORTANT: The field LastName is always mandatory!
    Any request without a LastName will fail. (If other fields are mandatory in your org, e.g. by validation rules, these have to be mandatory in your form too.)

    <label for="FirstName">First name</label><br/>
    <input type="text" size="20" name="FirstName" maxlength="40" id="FirstName" /><br/>
    </p>
    <p>
    <label for="LastName">Last name</label><br/>
    <input type="text" size="50" name="LastName" maxlength="80" id="LastName" /><br/>
    </p>
    [...]
  6. If you like to add multi-picklist fields like 'Purchase Unit Type' you must add '[]' to the Propertybase API Name for every checkbox...

    <p>
    <label for="type-lot">Apartment</label>
    <input type="checkbox" class="checkbox" name="InterestPurchaseUnitType__c[]" id="InterestPurchaseUnitType__c" value="Apartment"/>

    <label for="type-lot">Villa</label>
    <input type="checkbox" class="checkbox" name="InterestPurchaseUnitType__c[]" id="InterestPurchaseUnitType__c" value="Villa"/>

    <label for="type-lot">Office</label>
    <input type="checkbox" class="checkbox" name="InterestPurchaseUnitType__c[]" id="InterestPurchaseUnitType__c" value="Office"/>
    </p>

    ... and you also need to change the Javascript in the header of our example script. Please add your multi-picklist-field to the multiPicklistFields array. You can of course add more than one multi-picklist to your form, just add all fieldnames to the array.

    <script type="text/javascript">
    function checkSubmit() {

    // Please enter all ID's of your Multi-Select-Fields into this array.
    multiPicklistFields = new Array("InterestPurchaseUnitType__c");
    [...]
  7. Integrate the Form to your website and start collecting Prospects.



The complete Example:
<html>
<head>
<title>Lead Capture Form</title>
<script type="text/javascript">
function checkSubmit() {

// Please enter all ID's of your Multi-Select-Fields into this array.
multiPicklistFields = new Array("InterestPurchaseUnitType__c");

// Enter the name of your form here. DEFAULT: web2prospect
var formName = "web2prospect";

// DONT'T TOUCH THE CODE AFTER THIS LINE
for (var y=0; y < multiPicklistFields.length; y++) {
var string = "";
var field = multiPicklistFields[y];
for (var i=0; i < document.forms[formName].elements[field].length; i++) {
if (document.forms[formName].elements[field][i].checked) {
string += document.forms[formName].elements[field][i].value + "; ";
}
}
string = string.substr(0, string.length - 2);
field = document.createElement("input");
field.type = "hidden";
field.name = multiPicklistFields[y];
field.value = string;
document.forms[formName].appendChild(field);
}
return true;
}
</script>
</head>
<body>
<h1>Contact</h1>

<form name="web2prospect" onsubmit="return checkSubmit();" method="get" action="ENTER_YOUR_SALESFORCE_SITES_URL_HERE/pb__WebserviceWebToProspect">
<input type="hidden" name="PersonLeadSource" value="Web" />
<input type="hidden" name="success_page" value="http://ENTER_YOUR_WEBSITE_URL_HERE/lead_success.html" />
<input type="hidden" name="fail_page" value="http://ENTER_YOUR_WEBSITE_URL_HERE/lead_fail.php" />
<!-- Insert 'true' into value, to get an error message if the web2prospect process fail. DEFAULT: false-->
<input type="hidden" name="return_error" value="false" />
<p>
<label for="FirstName">First name</label><br/>
<input type="text" size="20" name="FirstName" maxlength="40" id="FirstName" /><br/>
</p>
<p>
<label for="LastName">Last name</label><br/>
<input type="text" size="50" name="LastName" maxlength="80" id="LastName" /><br/>
</p>
<p>
<label for="PersonEmail">Email</label><br/>
<input type="text" size="50" name="PersonEmail" maxlength="80" id="PersonEmail" /><br/>
</p>
<p>
<label for="Phone">Telephone</label><br/>
<input type="text" size="50" name="Phone" maxlength="40" id="Phone" /><br/>
</p>
<p>
<label for="CountryOfResidence__pc">Country</label><br/>
<input type="text" size="20" name="CountryOfResidence__pc" maxlength="40" id="CountryOfResidence__pc" /><br/>
</p>
<p>
<label for="InterestBuyBudgetFrom__c">Interest Buy Budget From</label><br/>
<input type="text" class="textfield" name="InterestBuyBudgetFrom__c" id="price-min" /><br/>
</p>
<p>
<label for="type-lot">Apartment</label>
<input type="checkbox" class="checkbox" name="InterestPurchaseUnitType__c[]" id="InterestPurchaseUnitType__c" value="Apartment"/>

<label for="type-lot">Villa</label>
<input type="checkbox" class="checkbox" name="InterestPurchaseUnitType__c[]" id="InterestPurchaseUnitType__c" value="Villa"/>

<label for="type-lot">Office</label>
<input type="checkbox" class="checkbox" name="InterestPurchaseUnitType__c[]" id="InterestPurchaseUnitType__c" value="Office"/>
</p>
<p>
<label for="Description">Your Message</label><br/>
<textarea rows="2" name="Description" maxlength="2000" id="Description" style="width: 305px;" /></textarea><br/>
</p>
<p>
<input type="submit" value="Submit" name="submit" />
</p>
</form>
</body>
</html>

 
Notes: 
 
  • By default, only "last name" is a mandatory field in Propertybase. If you changed your settings so that other fields are mandatory too, make sure your webform sends all mandatory fields. Otherwise your request will fail.
  • If you are sending your data from a script on your server instead from the browser directly, please make sure to URL encode all parameters. 
  • If your using a server script, you can also skip the success_page and fail_page as you will probably deal with success and error results in your script directly
 
 
 
Powered by Zendesk