User Tools

Site Tools


leads_integration2

Direct Post Interface

The Direct Post interface is a simple way to collect data from your website forms in channelLEADS. No programming is necessary beyond setting up the correct fields in your HTML form.

If you want to submit leads from a program instead of from a web form, please review our channelLEADS REST API documentation. Note that Direct Post uses the REST API under the hood, so most of this page applies to API users as well.

Technical Overview

The approach is this: you supply a form on your website and POST the form to our server. The information entered on the form will then be stored and ready for distribution. There are certain required fields (see “REQUIRED fields” below) that are necessary in order to process the leads. You may also add optional standard fields and define your own custom fields if you want to capture extra information about the prospective Lead.

Integration Steps

Using Direct Post from a web form requires some setup in channelLEADS and some web work.

In channelLEADS...

  1. Set up a direct post source and scheme entry in LEADpiper under Leads→Sources & Import Schemes. This step will register your form with channelLEADS, and you'll be given a “Direct Post Key” to use in your form to identify yourself to channelLEADS.

In your website code...

  1. Make an html page for your lead form, using the sample form as starting point. Don't forget to add your Direct Post Key in the form.
  2. Test the form. To make testing easier, the sample form includes a checkbox for the “saveRecord” field. When checked, the server will echo back details submitted. When not checked, the lead should show up in your lead distribution queue in LEADpiper. Once you confirm that the form is functional, proceed to next step.
  3. Remove the saveRecord checkbox from your form.
  4. Customize the form to match look and feel of your site.
  5. Install the form on your webserver.
  6. Start using the newly defined lead generation form!

Sample HTML Code

The sample form has html code you can cut and paste into a page on your website, test, and then customize as needed. It includes client side javascript validation to check for required fields. The only required customization is to add your Direct Post Key to the directPostKey hidden field value.

Form Contents

Your website Direct Post form can contain “standard fields” and “custom fields”. We recommend using standard field names whenever possible because it makes it easier to maintain consistency between multiple lead sources. Some of the standard fields are required – the form data must include a valid directPostKey, and contain data in the “email” field and “contact” field.

FieldRequiredHiddenDescription
emailY Email Address
contactY Contact Name (first and last)
company Company Name
directPostKeyYYidentifies this form to channelLEADS
thankYouUrl Yuser will be redirected to this URL after submitting form
phone1 Phone Number
street1 Street Address
city City
stateProvince State or Province
country Country
postalCode Postal Code
saveRecord Yfor debugging: set to 0 to echo form data instead of saving lead
apiFlag Ywhen set, return XML response instead of thank you page, for automated submission only
comments Ysee “spam trap” discussion below

Notes:

  1. All fields names are case sensitive.
  2. When using ampersand characters in select/hidden field values, do not entity encode.
  3. The hidden fields listed above are not sent to the lead recipient. If you choose to add additional hidden fields, they can be sent to lead recipients. See Custom Fields section below for more details.

REQUIRED fields

The following field is required in order to create a new Lead:

  • email - the e-mail address of the contact belonging to the company
<input value="" name="email" type="text" id="email" />

You must also include at least one of the following fields:

  • contact
<input value="" name="contact" type="text" id="contact" />

The following hidden field is required in order to process the submission.

  • directPostKey - The value of this field must match the directPostKey assigned to you setup in the Sources & Schemes area in channelLEADS.
<input type="hidden" name="directPostKey" value="AAAA BBBB CCCC DDDD" />

OPTIONAL fields

There are several other standard fields you may optionally use in your lead data. The geography related fields are useful to category leads into markets and provide automated handling.

The optional standard fields include:

  • company
  • phone1
  • street1
  • city
  • stateProvince
  • country
  • postalCode
  • interest

You may also include the following optional hidden fields to control aspects of the form processing:

  • saveRecord - this hidden field is used for testing your form. When it is set to 0, submitted form contents are echoed back to the screen and are NOT submitted to the LEADpiper database. If this field doesn't exist, or is set to any value other than 0, the form is processed normally.
  • apiFlag - this flag is set when you want an xml response. Should be used only for ”API mode”, and not in html forms.
  • comments - this field name is reserved for use as a “spam trap” as described below.
  • thankYouUrl - the user will be redirected to this URL after submitting form. It should be a full URL starting with “http:” or “https:”

CUSTOM fields

To capture additional fields beyond the standard fields, prepend the name of the field with 'x-'. For example if your custom field is 'color', give it a form element name of 'x-color'. The captured fields will appear in the additional information section of leads as key value pairs. The 'x-' will not appear in the custom field name when displayed on the site.

Caution: Be careful not to use any of the standard field names listed above (ie: 'x-company'.) The custom field will trump the related standard field in these cases.

Anti-spam: the 'comments' hidden field

Forms on public websites are often targets for “spambots” – automated “spiders” that wander around the web looking for forms. The spambot puts its irrelevant message in whatever fields it can find, and submits the form in the hopes that the posted content will show up somewhere where it will be seen. These submissions would show up as bogus entries in your leads database. Quite annoying.

Spambots aren't very sophisticated, and they can be effectively defeated by using a “captcha”, the most common example being to ask your users to type in the text from a distorted text image. This works, but it's irritating to your users.

We use a simpler method called a spam trap or “honeypot”. We add a field to your form that users can't see, but that the spambots can't easily identify as a hidden field. The spambots will typically insert content into this field. If the field isn't empty, it's usually a spambot submission, and we reject it with an appropriate error message. The field contains a label that instructs users of alternative browsers (handicapped-accessible screen readers, for example) to leave the field empty. This method is very effective, and causes no problems for legitimate users.

To implement the spam trap, simply add the following hidden span tag containing the empty field 'comments' in your form:

<span style="display:none;visibility:hidden;">
<label for="comments">Ignore this text box. It is used to detect spambots. If you enter anything into this text box, your submission will be rejected.</label>
<input type="text" name="comments" size="1" value="" id="comments" />
</span>

Javascript Include

A javascript file is provided that implements client-side validation for your direct post form. The files can be loaded from the LEADpiper server as shown, or if you prefer you can download the files and host them on your server.

Add this in the <head> section of your html form:

<!-- LEADpiper REQUIRED -->
<script type="text/javascript" src="http://[your channelSUITE install]/API/v2/js/leadsForm.js"></script>
<!-- end LEADpiper REQUIRED →

Thank You Page

LEADpiper will redirect the user to the specified “thank you” page after they submit the lead form. To enable the thank you page, put a full URL (beginning with http: or https:) in the thankYouUrl field.

If you don't specify a “thank you” page, the user will be shown a generic thank you page and they'll need to use their browser's back button to get back to your site.

leads_integration2.txt · Last modified: 2012/09/14 17:54 by jason