Capturing Leads from Website forms

You can capture Leads from your website in LeadSquared. There are three common ways of doing it:

  1. Embed LeadSquared Forms on your website as iFrame
  2. Embed LeadSquared Forms on your website as  HTML
  3. For WordPress sites:  Use LeadSquared’s Contact  Form 7 Plugin
  4. Use LeadSquared API to capture Leads

Embed LeadSquared Forms on your website as iFrame

Create a  form using LeadSquared Landing Page Designer. The form should have lead fields that you want to capture when Lead submits on your website.

Step 1: Navigate to Marketing -> Landing Pages and click “Create Landing Page” button to open landing page designer. Select blank template and press next.

Form only LP Select Template

Step 2: Add a form on the page.

Form Block

Step 3: Double click the form to customize it. Add the fields you want. You can add hidden fields with default value if you want some data to be captured for every lead.  You can make fields mandatory.  Define header and footer for the form.

Customize Form

Step 4: Use the properties panel to change style of the form:

Properties Panel

Step 5: Press Next and specify and form submission actions and SEO options .

Step 6: Publish the page

Publish Page

Step 7: Navigate to Marketing -> Landing Pages and locate the page you just published.  Go to actions available on page and select “Embed”:

Embed option

Step 8: Copy the embed code that is shown. Note that this is iFrame code. You should replace the form on your website with this code. 

Copy Embed Code

Once you put the iFrame code, you will see the form getting loaded alongwith your web page.

Important Notes about using iFrame form code on your website:

  1. The entire landing page is embedded
  2. The form color, fields and layout is controlled by LeadSquared app. Your website stylesheet will not impact it. If you want to control the form format in your website, use the option “Embed LeadSquared Forms on your website as HTML” described in next section.
  3. Adjust the height and width of the form as per the space available to it on your website. For example you can make width=”100%” for responsive pages and height=”1000″ if the form is long.
  4. Every time you make change in the form, your need to republish it within LeadSquared. There is no need to embed the form again.
  5. The embed form code should be above LeadSquared Website tracking script on your page to enable accurate lead source tracking.
  6. If you chose “Is Redirect to URL” option in Step 03 (Actions) then the redirected page will open in the same iFrame. If you want the main page to redirect, refer to this article:  How to redirect the host page after lead submits on embedded form?

Embed LeadSquared Forms on your website as HTML

Follow Steps 1 to 6 described in previous section. In Step 3 & 4 you don’t need to worry about the form layout and formatting. You should just select form fields, change field display names if needed, make them mandatory or hidden.  Changing color, style etc is not needed.

Step 7: Navigate to Marketing -> Landing Pages and locate the page you just published.  Go to actions available on page and select “Export Form HTML”:

Export Form HTML

Copy the HTML code that is shown. Note that this is <form></form> html code. You should replace the form on your website with this code. 

Embed

Once you put the code, it will become part of your website.

Important Notes about using Form  HTML code on your website:

  1.  The HTML that you get does not have any formatting or style information. Your website CSS should control the rendering for the form.
  2. The mandatory fields have required=’required’ parameter set which will work on websites using HTML 5.  You will need to write custom validations (usually in JavaScript) if your are not on HTML 5.
  3. Any validation apart from mandatory field checked needs to be done in your web page. The form code will not have any validation code.
  4. Every time you make change in the form, your need to republish it within LeadSquared. You will need to get the Form HTML and replace your existing form HTML code in your website. 
  5. The embed form code should be above LeadSquared Website tracking script on your page to enable accurate lead source tracking.

For WordPress sites:  Use LeadSquared’s Contact 7 Plugin

If you are having a site built on WordPress, you can use Contact Form 7 to capture Leads.  Leads from Contact Form 7 can be captured in LeadSquared using our plugin for it.

Check this help article to use the plugin

Use LeadSquared API to capture Leads

If you don’t want to make any changes to your website and still want to capture leads in LeadSquared, you may use our APIs.

LeadSquared supports REST APIs, and we accept and return JSON data.

Step 1:  Get Access Key and Secret key of an Admin user of LeadSquared

Step 2: Get  lead meta data  using GET call on  https://api.leadsquared.com/v2/LeadManagement.svc/LeadsMetaData.Get?accessKey=<accessKey>&secretKey=<secretKey>

Replace <accessKey> and <secretKey> with the value you got in Step 1.  Check the SchemaName of the fields from the data that you get. SchemaName is the internal name of the field that you will use in all your Lead API calls.

Step 3: Prepare data that needs to be posted as JSON. An example is given below.

[ { “Attribute”: “EmailAddress”, “Value”: “john.smith@acmeconsulting.co” }, { “Attribute”: “FirstName”, “Value”: ” John” }, { “Attribute”: “LastName”, “Value”: ” Smith” } ]

Step 4: POST the data on  https://api.leadsquared.com/v2/LeadManagement.svc/Lead.Create?accessKey=<accessKey>&secretKey=<secretKey>

Here are help articles on using APIs:

  1. API Overview
  2. Lead Management API
  3. Sample Code

Was this Helpful?

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments