Handling website contact leads in CreataCRM
Collecting Leads from your website
There are two easy ways to integrate your websites Contact Us form into CreataCRM
- Insert a CreataCRM client page into your website with an iFrame
- Configure your own Contact us form so that it sends it's data to CreataCRM
Sending CreataCRM the data from your own Contact Form
If you already have a Contact Us form setup on your website, you can send your form data to CreataCRM with some simple Javascript. You will need the following:
- WORKFLOW_NAME - Name of the workflow that will handle the data
- URL_ADDRESS - Your CreataCRM address, e.g. https://demo.creatacrm.com
- API_KEY - The API Key from your CreataCRM
See below for an example of how to post some form data to CreataCRM with jQuery
//Store your CreataCRM API details in your contact page
var urlFormat = "/Handlers/Zapier.ashx?action=RunWorkflow&name=";
var workflow = "<WORKFLOW_NAME>";
var urlAddress = "<URL_ADDRESS>";
var apiKey = "<API_KEY>";
//Build your CreataCRM URL
var url = urlAddress + urlFormat + workflow + "&api_key=" + apiKey;
//Collect your form data
var formData = {
"FirstName": $("#firstname").val(),
"LastName": $("#surname").val(),
"Company": $("#company").val(),
"Phone": $("#phone").val(),
"Email": $("#email").val(),
"Subject": $("#subject").val(),
"Message": $("#message").val(),
"Tag": ClientPortal.GetQueryParameterByName('Tag'),
}
//Send the form data to CreataCRM
$.ajax({
type: "POST",
url: url,
data: JSON.stringify(formData)
});
Integrating the Contact Form iframe
Using Client Pages, you can create a Contact Us form in CreataCRM. Then, you can integrate this in your website simply by adding an iFrame that references your CreataCRM Client Page.
You can copy the Embedded Link on the Client Page from CreataCRM, as an easy method of integration
iFrame Parameters
Do you have a need for multiple Contact Us forms, that require a preset Tag depending on the form? You can send parameters to your CreataCRM Client Page through your iFrames QueryString Parameters. Simply add
&Tag=WebsiteContactLead
Into the iFrame QueryString:
<iframe scrolling="no" src="https://demo.creatacrm.com/Portals/ClientPages/ProcessPage.aspx?PageOid=fa040f29-ba88-47e8-8ef3-c2da9595d001&Tag=WebsiteContactLead"></iframe>
Then you can access it in the Client Page:
var tag = ClientPortal.GetQueryParameterByName('Tag');
After this, you can configure the Client Page to send it to your Workflow, and then use the value in Workflow to assign your Lead to the WebsiteContactLead Tag
Handling your data in Workflow
You will need to configure a workflow in CreataCRM to habdle the data coming in from the Contact Form. You can import the text below into the Workflow Designer for an example of a basic workflow that creates a Contact from the form data.
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="variables_set" id="1" x="85" y="-290"><field name="To">creataFirstName</field><value name="Value"><block type="GetValueFromJSONBlock" id="2"><value name="TheField"><block type="text" id="3"><field name="TEXT">FirstName</field></block></value></block></value><next><block type="variables_set" id="4"><field name="To">creataEmail</field><value name="Value"><block type="GetValueFromJSONBlock" id="5"><value name="TheField"><block type="text" id="6"><field name="TEXT">Email</field></block></value></block></value><next><block type="variables_set" id="7"><field name="To">creataLastName</field><value name="Value"><block type="GetValueFromJSONBlock" id="8"><value name="TheField"><block type="text" id="9"><field name="TEXT">LastName</field></block></value></block></value><next><block type="variables_set" id="10"><field name="To">creataPhone</field><value name="Value"><block type="GetValueFromJSONBlock" id="11"><value name="TheField"><block type="text" id="12"><field name="TEXT">Phone</field></block></value></block></value><next><block type="variables_set" id="13"><field name="To">creataSubject</field><value name="Value"><block type="GetValueFromJSONBlock" id="14"><value name="TheField"><block type="text" id="15"><field name="TEXT">Subject</field></block></value></block></value><next><block type="variables_set" id="16"><field name="To">creataMessage</field><value name="Value"><block type="GetValueFromJSONBlock" id="17"><value name="TheField"><block type="text" id="18"><field name="TEXT">Message</field></block></value></block></value><next><block type="controls_if" id="19"><mutation else="1"></mutation><value name="IF0"><block type="logic_compare" id="20"><field name="LogicOperation">Equal</field><value name="LeftOperand"><block type="variables_get" id="21"><field name="VAR">creataEmail</field></block></value><value name="RightOperand"><block type="text" id="22"><field name="TEXT"></field></block></value></block></value><statement name="DO0"><block type="variables_set" id="23"><field name="To">existing</field><value name="Value"><block type="find_object" id="24"><field name="TypeName">CreataCRM.Library.Contacts.Contact</field><value name="Filter"><block type="string_format" id="25"><mutation params="2"></mutation><field name="FormatParam0">FirstName</field><field name="FormatParam1">LastName</field><value name="FormatString"><block type="text" id="26"><field name="TEXT">[FirstName] = '*|FirstName|*' And [LastName] = '*|LastName|*' And ([Email] is null or [Email] = '')</field></block></value><value name="FormatValue0"><block type="variables_get" id="27"><field name="VAR">creataFirstName</field></block></value><value name="FormatValue1"><block type="variables_get" id="28"><field name="VAR">creataLastName</field></block></value></block></value></block></value></block></statement><statement name="ELSE"><block type="variables_set" id="29"><field name="To">existing</field><value name="Value"><block type="find_object" id="30"><field name="TypeName">CreataCRM.Library.Contacts.Contact</field><value name="Filter"><block type="string_format" id="31"><mutation params="3"></mutation><field name="FormatParam0">FirstName</field><field name="FormatParam1">LastName</field><field name="FormatParam2">Email</field><value name="FormatString"><block type="text" id="32"><field name="TEXT">[FirstName] = '*|FirstName|*' And [LastName] = '*|LastName|*' And [Email] = '*|Email|*'</field></block></value><value name="FormatValue0"><block type="variables_get" id="33"><field name="VAR">creataFirstName</field></block></value><value name="FormatValue1"><block type="variables_get" id="34"><field name="VAR">creataLastName</field></block></value><value name="FormatValue2"><block type="variables_get" id="35"><field name="VAR">creataEmail</field></block></value></block></value></block></value></block></statement><next><block type="controls_if" id="36"><mutation else="1"></mutation><value name="IF0"><block type="null_check" id="37"><value name="TheObject"><block type="variables_get" id="38"><field name="VAR">existing</field></block></value></block></value><statement name="DO0"><block type="variables_set" id="39"><field name="To">newActivity</field><value name="Value"><block type="create_new_object" id="40"><field name="NewObjectType">Activity</field></block></value><next><block type="set_member" id="41"><field name="Typename">CreataCRM.Library.Activities.Activity</field><field name="FieldName">ActivityType</field><value name="Object"><block type="variables_get" id="42"><field name="VAR">newActivity</field></block></value><value name="NewValue"><block type="find_object" id="43"><field name="TypeName">CreataCRM.Library.Activities.ActivityType</field><value name="Filter"><block type="text" id="44"><field name="TEXT">[Name] = 'To-Do'</field></block></value></block></value><next><block type="set_member" id="45"><field name="Typename">CreataCRM.Library.Activities.Activity</field><field name="FieldName">Subject</field><value name="Object"><block type="variables_get" id="46"><field name="VAR">newActivity</field></block></value><value name="NewValue"><block type="string_format" id="47"><mutation params="2"></mutation><field name="FormatParam0">Subject</field><field name="FormatParam1">Message</field><value name="FormatString"><block type="text" id="48"><field name="TEXT">Online Enquiry Form - *|Subject|*</field></block></value><value name="FormatValue0"><block type="variables_get" id="49"><field name="VAR">creataSubject</field></block></value><value name="FormatValue1"><block type="variables_get" id="50"><field name="VAR">creataMessage</field></block></value></block></value><next><block type="set_member" id="51"><field name="Typename">CreataCRM.Library.Activities.Activity</field><field name="FieldName">Owner</field><value name="Object"><block type="variables_get" id="52"><field name="VAR">newActivity</field></block></value><value name="NewValue"><block type="get_user" id="53"><field name="UserName">Admin</field></block></value><next><block type="set_member" id="54"><field name="Typename">CreataCRM.Library.Activities.Activity</field><field name="FieldName">Description</field><value name="Object"><block type="variables_get" id="55"><field name="VAR">newActivity</field></block></value><value name="NewValue"><block type="string_format" id="56"><mutation params="2"></mutation><field name="FormatParam0">Subject</field><field name="FormatParam1">Message</field><value name="FormatString"><block type="text" id="57"><field name="TEXT">*|Message|*</field></block></value><value name="FormatValue0"><block type="variables_get" id="58"><field name="VAR">creataSubject</field></block></value><value name="FormatValue1"><block type="variables_get" id="59"><field name="VAR">creataMessage</field></block></value></block></value><next><block type="add_to_collection" id="60"><value name="ObjectToAdd"><block type="variables_get" id="61"><field name="VAR">existing</field></block></value><value name="Collection"><block type="get_member" id="62"><field name="TypeName">CreataCRM.Library.Activities.Activity</field><field name="TheField">Contacts</field><value name="TheObject"><block type="variables_get" id="63"><field name="VAR">newActivity</field></block></value></block></value><next><block type="add_to_collection" id="64"><value name="ObjectToAdd"><block type="get_user" id="65"><field name="UserName">Admin</field></block></value><value name="Collection"><block type="get_member" id="66"><field name="TypeName">CreataCRM.Library.Activities.Activity</field><field name="TheField">Users</field><value name="TheObject"><block type="variables_get" id="67"><field name="VAR">newActivity</field></block></value></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><statement name="ELSE"><block type="variables_set" id="68"><field name="To">existing</field><value name="Value"><block type="create_new_object" id="69"><field name="NewObjectType">Contact</field></block></value><next><block type="set_member" id="70"><field name="Typename">CreataCRM.Library.Contacts.Contact</field><field name="FieldName">FirstName</field><value name="Object"><block type="variables_get" id="71"><field name="VAR">existing</field></block></value><value name="NewValue"><block type="variables_get" id="72"><field name="VAR">creataFirstName</field></block></value><next><block type="set_member" id="73"><field name="Typename">CreataCRM.Library.Contacts.Contact</field><field name="FieldName">LastName</field><value name="Object"><block type="variables_get" id="74"><field name="VAR">existing</field></block></value><value name="NewValue"><block type="variables_get" id="75"><field name="VAR">creataLastName</field></block></value><next><block type="set_member" id="76"><field name="Typename">CreataCRM.Library.Contacts.Contact</field><field name="FieldName">Email</field><value name="Object"><block type="variables_get" id="77"><field name="VAR">existing</field></block></value><value name="NewValue"><block type="variables_get" id="78"><field name="VAR">creataEmail</field></block></value><next><block type="set_member" id="79"><field name="Typename">CreataCRM.Library.Contacts.Contact</field><field name="FieldName">DirectPhone</field><value name="Object"><block type="variables_get" id="80"><field name="VAR">existing</field></block></value><value name="NewValue"><block type="variables_get" id="81"><field name="VAR">creataPhone</field></block></value><next><block type="set_member" id="82"><field name="Typename">CreataCRM.Library.Contacts.Contact</field><field name="FieldName">Comments</field><value name="Object"><block type="variables_get" id="83"><field name="VAR">existing</field></block></value><value name="NewValue"><block type="string_format" id="84"><mutation params="2"></mutation><field name="FormatParam0">Subject</field><field name="FormatParam1">Message</field><value name="FormatString"><block type="text" id="85"><field name="TEXT">*|Subject|* - *|Message|*</field></block></value><value name="FormatValue0"><block type="variables_get" id="86"><field name="VAR">creataSubject</field></block></value><value name="FormatValue1"><block type="variables_get" id="87"><field name="VAR">creataMessage</field></block></value></block></value><next><block type="variables_set" id="88"><field name="To">Company</field><value name="Value"><block type="find_object" id="89"><field name="TypeName">CreataCRM.Library.Companies.Company</field><value name="Filter"><block type="string_format" id="90"><mutation params="1"></mutation><field name="FormatParam0">Name</field><value name="FormatString"><block type="text" id="91"><field name="TEXT">[Name]='*|Name|*'</field></block></value><value name="FormatValue0"><block type="GetValueFromJSONBlock" id="92"><value name="TheField"><block type="text" id="93"><field name="TEXT">Company</field></block></value></block></value></block></value></block></value><next><block type="controls_if" id="94"><mutation else="1"></mutation><value name="IF0"><block type="null_check" id="95"><value name="TheObject"><block type="variables_get" id="96"><field name="VAR">Company</field></block></value></block></value><statement name="DO0"><block type="set_member" id="97"><field name="Typename">CreataCRM.Library.Contacts.Contact</field><field name="FieldName">PrimaryCompany</field><value name="Object"><block type="variables_get" id="98"><field name="VAR">existing</field></block></value><value name="NewValue"><block type="variables_get" id="99"><field name="VAR">Company</field></block></value></block></statement><statement name="ELSE"><block type="variables_set" id="100"><field name="To">Company</field><value name="Value"><block type="create_new_object" id="101"><field name="NewObjectType">Company</field></block></value><next><block type="set_member" id="102"><field name="Typename">CreataCRM.Library.Companies.Company</field><field name="FieldName">Name</field><value name="Object"><block type="variables_get" id="103"><field name="VAR">Company</field></block></value><value name="NewValue"><block type="GetValueFromJSONBlock" id="104"><value name="TheField"><block type="text" id="105"><field name="TEXT">Company</field></block></value></block></value><next><block type="set_member" id="106"><field name="Typename">CreataCRM.Library.Contacts.Contact</field><field name="FieldName">PrimaryCompany</field><value name="Object"><block type="variables_get" id="107"><field name="VAR">existing</field></block></value><value name="NewValue"><block type="variables_get" id="108"><field name="VAR">Company</field></block></value></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><next><block type="variables_set" id="109"><field name="To">Tag</field><value name="Value"><block type="find_object" id="110"><field name="TypeName">CreataCRM.Library.Tags.Tag</field><value name="Filter"><block type="string_format" id="111"><mutation params="1"></mutation><field name="FormatParam0">Name</field><value name="FormatString"><block type="text" id="112"><field name="TEXT">[Name]='*|Name|*'</field></block></value><value name="FormatValue0"><block type="GetValueFromJSONBlock" id="113"><value name="TheField"><block type="text" id="114"><field name="TEXT">Tag</field></block></value></block></value></block></value></block></value><next><block type="controls_if" id="115"><value name="IF0"><block type="null_check" id="116"><value name="TheObject"><block type="variables_get" id="117"><field name="VAR">Tag</field></block></value></block></value><statement name="DO0"><block type="add_to_collection" id="118"><value name="ObjectToAdd"><block type="variables_get" id="119"><field name="VAR">Tag</field></block></value><value name="Collection"><block type="get_member" id="120"><field name="TypeName">CreataCRM.Library.Contacts.Contact</field><field name="TheField">Tags</field><value name="TheObject"><block type="variables_get" id="121"><field name="VAR">existing</field></block></value></block></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>