CRM3® has a powerful system for capturing contact information from web pages. Generally, these are referred to as Lead Capture, Registration, or Feedback forms. Our general term of use is the last of these. The system has a minimal set of required fields, some optional fields, and a way to define dynamic fields for complete customization. Additionally, forms can be chained together across pages to produce questionnaires, etc.
Note: N.B. Red indicates special instructions for features yet to be implemented.
All feedback forms must post to a URL similar to the following example:
<form action="http://[account].CRM3.com/webservices/auth.asmx/signup">
Where [account] is the name of the sub-domain for the account where the contact will reside (e.g., cmaeon.CRM3.com). If the account is going to be set dynamically, then the domain should be portal.CRM3.com and a hidden field with name of ”account” and the value of the account’s name should be dynamically set.
N.B. Sub-domain account recognition is not yet available. For now, use portal.CRM3.com and the hidden account field for all feedback forms.
You need to add a little JavaScript to update forms from URL parameters. This is a handy tool as you can pass information from a link in an email to pre-populate a form. Code for Prototype and JQuery are provided below. Add it to the bottom of your page.
Prototype version
<script type=”text/javascript”>
varqueryParams = document.URL.toQueryParams();
for(varparam in queryParams)
{
var input = $$('form [name="'+param+'"]');
if(input.length> 0)
{
input = input[0];
input.value = unescape(queryParams[param]);
}
}
</script>
JQuery version
<script type=”text/javascript”>
$.extend(
{
getUrlVars: function()
{
varvars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i <hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
returnvars;
},
getUrlVar: function(name)
{
return $.getUrlVars()[name];
}
});
varqueryParams = $.getUrlVars();
for(varparam in queryParams)
{
var input = $('form [name="'+param+'"]');
if(input.length> 0)
{
input = input[0];
input.value = unescape(queryParams[param]);
}
}
</script>
Use the hidden field profile_id along with required fields. Whenever the lead insert application runs and redirects to the success_url, it appends the parameter profile_id in the string, so subsequent forms can be filled out.
Dynamic content appears in CRM3® within the Feedback gadget in the Contact view. Input must be named after their type, followed by an underscore, and then a descriptive name with words separated by underscores. Examples of supported inputs are as follow.
Name |
Result |
checkbox_Will_Travel |
Will Travel followed by true or false |
radio_Budget_Range |
Budget Range followed be input value |
select_Square_Footage |
Square Footage followed by the selected value |
text_Hotel |
Hotel followed by input text |
textarea_Comments |
Comments followed by input text |
N.B. The field names are case-sensitive. TEXT_Comments will NOT be recognized.
Everything after the first underscore will appear in CRM3® with underscores parsed into spaces - followed by the submitted value.
- project: value is the name of a new or existing project. If not defined then the default project for the account will be used.
- profile_id: value is the profile ID of an existing contact. Optional forms are contact_id or person_id however all reference a contact’s profile ID so the new form is much preferred. If this value is passed, then the associated contact will be updated.
Whenever multi-page feedback is employed, the second and later pages have profile_id=#### added to their URL. In this manner, original contact information from the first page can be added to or amended by later pages. - process_type_name: value is the name of the type of process to be used for the new lead. Optional form is sales_process. Use the sales_process form for now.
If the contact already exists and an existing process of this type is found for the contact, it will be updated. If no process is defined, then the account’s default process is used. - process_name: value is the name for the process. If not specified, the process_type_name will be used.
- assignee_name: value is the name of the user that the process will be assigned to. This feature is not yet available.
- stage_name: value is the name of the stage to place the lead. If not specified, the first stage within the process will be used.
- step_name: value is the name of the step to place the lead. If not specified, the first step within the stage will be used.
- closing_value: value is the amount that closing the business process will benefit the company. Generally, the amount is a dollar figure but this could be used to track beans or widgets. This value should only include digits and optional commas or a decimal place. All non-numeric characters will be stripped out at the time of capture. Multiple decimal places will not cause the capture to fail but will result in this field not being capture.
- process_mappedid: TBD
- process_mapping: TBD
- tags: value is a comma-separated list of tags to add to the lead.
- untags: value is a comma-separated list of tags to remove from the lead. This feature is not yet available.
- template: The name of the template under which the feedback will be grouped. If the template exists, then the content of the form must match its contents. If the template does not exist, one will be auto-generated.
- profile_mappedid: TBD
- profile_mapping: TBD
- roleName: TBD
- password: TBD
- project_mappedid: TBD
- project_mapping: TBD
- account: value is the name of the account for the lead. Soon, as described above, the account will be able to be determined from the sub-domain and this field will become optional.
- success_url: value is the URL redirected to upon success.
- failed_url: value is the URL redirected to upon failure.
- category, subcategory, and source: combined, these three values indicate how a contact found us from least granular to most granular. For instance: “Events”, “Trade Shows”, and “South Vancouver Island Marketing Alliance”.
A category of GLP is reserved for CMaeON’s use in lead capture campaigns.
When Google campaigns are run, subcategory can be dropped in favor of network (Search, etc.) and source can be dropped in favor of adgroup. The name of an ad group will have dashes and underscores replaced with spaces to make them more readable. - rank: value is the rank of the new lead. Rank must be selected from existing ranks within the account. See Administration/Settings/Private Ranks.
While not absolutely required, firstname, lastname, and email should be placed on every form for the contact to have minimal useability.
- first_name: Optional form is firstname. Use the firstname form for now.
- middle_name: Optional form is middlename. Use the middlenameform for now.
- last_name: Optional form is lastname. Use the lastname form for now.
- name_suffix: value is placed after the name. For instance, Rod Olafson, B.Sc. Optional form is namesuffix. Use the namesuffix form for now.
- area_code: Optional form is area. Rarely used as contacts will often include area code within a phone number. If used, area_code will be added to the beginning of each phone number for the contact. Use the area form for now.
- phone: value is the primary phone number.
- business_phone: Optional form is businessphone. Use the businessphone form for now.
- mobile_phone: Optional form is mobilephone. Use the mobilephone form for now.
- home_phone: Optional form is homephone. Use the homephone form for now.
- fax
- pager
- primary_email: value is the primary email address. Optional form is email. Use the email form for now.
- email2: value is a secondary email address
- address_1: Optional formsare address1or just addressin place of the three fields.If three fields are desired, use the address1 form for now.
- address_2: Optional form is address2. Use the address2 form for now.
- address_3: Optional form is address3. Use the address3 form for now.
- city
- province_state: Optional forms are province or state. Use the province form for now.
- country
- postal_zip: Optional forms are postal or zip. Use the postal form for now.
- company
- job_title: Optional form is jobtitle. Use the jobtitle form for now.
- web_site: Optional form is website. Use the website form for now.
All feedback forms must post to a URL similar to the following example:
<form action="http://[account].CRM3.com/webservices/auth.asmx/signup">
Where [account] is the name of the sub-domain for the account where the contact will reside (e.g., cmaeon.CRM3.com). If the account is going to be set dynamically, then the domain should be portal.CRM3.com and a hidden field with name of ”account” and the value of the account’s name should be dynamically set.
N.B. Sub-domain account recognition is not yet available. For now, use portal.CRM3.com and the hidden account field for all feedback forms.
CRM3® Registration or Feedback Forms can be extended to generate filled PDF’s. Mapping HTML Registration Pages to PDF requires Adobe Acrobat Professional and some basic knowledge of XPath.
For documentation on Registration Forms please refer to Registration Pages Overview. Once you have created an HTML registration page open the associated PDF document in Adobe Acrobat. To make this PDF fillable each field in the HTML Registration Form will need to match a Form Field in the PDF document. To convert a PDF Document to a PDF Form follow the steps outlined below.
- Click Forms->Run Form Field Recognition. Acrobat will automatically create Fields where it determines one should exist.
- Check the document and manually create any form fields Acrobat missed.
To manually create Form Fields:
- Click Tools->Forms->Show Forms Toolbar
- A new toolbar will appear with buttons for creating fields of several types.
- Select a field type by clicking.
- Once selected click on the PDF to place the field.
When finished a Form Field should exist for each input in the HTML Registration Page. CRM3® will determine which fields to fill by reading the Name and Export Value of the Form Fields in the PDF. These names and values will be matched to the HTML inputs on the Registration Page. To set Field Properties follow the steps as outlined below.
- In Acrobat Click Tools->Forms->Edit Layout. If this option is missing ensure Edit Form In Acrobat is checked under the Forms menu.
- Once in edit mode it is possible to edit form properties by doubling clicking a Field or right clicking and selecting properties.
- In the Properties Dialog Box under Options make sure the Default Value is cleared.
- In the Properties Dialog Box under General set the Name to the appropriate XPath Statement as described in the XPath Section below.
Filling a radio button or checkbox requires the additional step of setting the Export Value.
- In properties dialog box under Options set the Export Value to match the value of the associated input on the HTML Registration page.
- All radio buttons in the same group need to have the same name.
Sample XPath:
CRM3® will fill the PDF by first generating an XML Document from any submitted Feedback Forms and contact information. To select a Node or value in this XML Document we specify an XPath statement. To map this value to the PDF document set the Name Property (of the PDF Form Field) to the XPath Statement. CRM3® will use the XPath Statements found in each form field to find its value. For sample XPath please continue reading.To select values from a Registration Form.
<form>
<input type=”text” name=”text_Field_Name” />
<input type=”radio” name=”radio_Choose_One” value=”Selected” />
<input type=”radio” name=”radio_Choose_One” value=”No I am Selected” />
<input type=”checkbox” name=”checkbox_Tick_Me” value=”Checked” />
To select the text Field:
//feedbackcollection[@templatename=Example_space_Template_space_Name']/item[@key='Field Name’]/@value
To select a radio button:
//feedbackcollection[@templatename=Example_space_Template_space_Name']/item[@key='Choose One’]/@value
*Remember to set the Export Value to “Selected” or “No I am Selected”.
To select the checkbox:
//feedbackcollection[@templatename=Example_space_Template_space_Name']/item[@key='Tick Me’]/@value
*Remember to set the Export Value to “Checked”.
To select values from the contact.
This XML has a more complicated structure. Download the sample here.
To select the contacts first name: //contact/contact/personalinfo/person/@firstname
To select the contacts home phone number: //contact/phonenumbers/phonenumber[@numbertypeid=2]/@number
For further information on XPath and XML please visit http://www.w3schools.com/xpath/xpath_syntax.asp .