Blog

The Salesforce Web to Lead functionality offers an easy way to get leads from your website into Salesforce. Although there are some constraints with its use, it will satisfy the requirements for many organizations. Salesforce also offers a way to associate the leads from the webpage to a particular campaign. You can also have multiple web-to-lead forms from multiple websites or landing pages, all inserting leads in Salesforce and either capturing the source of the lead or associating it with a particular campaign.

The Web-to-Lead  functionality in Salesforce generates a form which can be integrated in your website. This form then captures data which is used to create a new lead in salesforce. Just as the name suggest ‘Web-To-Lead’.

Implementation
To generate a web to lead form go to:
Setup ->Build ->Customize ->Leads ->Web-To-Lead

web-to-lead-1

Here we can enter the following :

  • Web-to-Lead Enabled ->Check this to enable Web-To-Lead in your organization
  • Default Lead Creator -> Creator of the Leads when created by Web-To-lead. If no lead owner is specified in lead settings and in absence of any lead assignment rules, this User/Queue will be the default lead owner.
  • Default Response Template -> Template used for lead auto response rule

web-to-lead-2

After completion of Web to Lead settings.

web-to-lead-3

  • Click On Generate Web-To-Lead Form
  • Select the fields which you require in the form.
  • Select any custom fields. In our case we consider a case where a customer will be filling an enquiry form for one of the three beauty products, which we name ‘A’, ‘B’ & ‘C’. To capture this I created a custom picklist field ‘Product Of Interest’ in the lead object.
  • Return URL to which the website will be redirected when the form will be submitted. Usually It’s a thank you page or home page. We will fill this field with URL of a ‘Thanks You’ image file

web-to-lead-4

  • Click on Generate
  • An HTML form will be generated as shown below:

web-to-lead-5

  • This is our web-to-lead form.
  • Copy this entire form and paste it in a notepad (Or notepad++, in general any text editor) and save it with extension ‘.htm’ or ‘.html’.

web-to-lead-6

  • That’s it. We just created a form that will help generate leads for us.
  • Open this file in a browser. You will see a web page like this :

web-to-lead-7

  • Give this to your web master.
  • They will integrate this web page in your website and add CSS to the web page to style it.

After applying CSS to the page and it can be transformed like this:

web-to-lead-8
If we look more closely at what the file actually contains:

web-to-lead-9

1 -> This hidden form element stores the Organization Id (oid) of our org.

2 -> This hidden form element stores the return URL mentioned during form creation.

3 -> The rest of the form elements are input elements which correspond to lead fields.

If we want to associate the created lead to a campaign and set the campaign member status to a predefined value then we need to add the following two lines to the generated form.

1)  Hidden form element which will store campaign ID.

To get the campaign Id :

  • Click on Campaign Tab
  • Find the required Campaign
  • Click on Campaign Name
  • In the URL you will find the Campaign ID as shown above :

web-to-lead-10

web-to-lead-11

2)  Hidden form element which will store the predefined status for the created Campaign member.

web-to-lead-12

Testing The Form :

  • Navigate to the webpage that is stored locally on your computer or on a server using your browser
  • Enter the form details
  • Click on Submit.

web-to-lead-13

After clicking Submit:

  • The page gets rediredected to return Url (which is a thank you image)

web-to-lead-14

  • A lead is created in our salesforce org.

To view :
1) Click on Leads Tab.
2) Select view ‘My Unread Leads’
3) Search your newly created Lead

web-to-lead-15

  • A Campaign member is created for the required campaign.

web-to-lead-16

web-to-lead-17

To view :
• Click on Campaigns Tab.
• Search and click your campaign
• You can find the newly added campaign member in ‘Campaign Members’ related list

  • Observe that status of the campaign member is ‘Responded’. Exactly what we set in the hidden form element.

Testing the Form:

Web master will have to uncomment the following lines in the form:

  • This hidden form element indicates if debugging is on or off. 1 means ON.
  • This email Id to which the response from from will go. Webmaster can replace the email-Id his/her own.

web-to-lead-18

Lead Settings :
Go To Setup->Build ->Customize ->Leads ->Settings

web-to-lead-19

  • Here you can specify the default lead owner.
  • Click on Edit ->Change the default lead owner.

web-to-lead-20

  • Click on Save. Default Lead owner is now changed.
  • So whenever a web-to-lead is created the ownership of the lead will be transferred to this User/Queue.

Notice that the lead creator is different than lead owner in the below lead (This is after default lead owner was specified in lead settings).

web-to-lead-21

Alternatively we can have leads assigned to different users based on the product selected by the customer in the form. To achieve this we can have lead assignment rules.

Points To Note :

  • During salesforce downtime or scheduled maintenance, leads are cached in a queue and inserted when salesforce instance starts running
  • In case of any error during lead creation, and if debug log is not set then an error email is sent to admin users
  • Maximum number of web-to-lead requests within 24 hours is ‘500’. Though It can be increased after contacting Salesforce.
  • To test web-to-lead in a Sandbox we must modify the action url in the html form. Instead of test we must replace it with instance number (cs0 or , cs1, or cs2 ….)
  • Check this link for further instructions:
  • https://help.salesforce.com/HTViewSolution?id=000038182&language=en_US
  •  Date formatting : Date format used in web form must be same as used in salesforce org
  • If ‘Company’ name is not provided then lead is created with default value ‘[not provided]’ since Company name is a required field.
  • The Salesforce system sends the email to the Default Lead Owner if the Daily Lead limit is exceeded.

The mail contains all the lead information, which we can use to manually create leads.

Limitations :

  • Limit of web-to-lead requests within 24 hours is ‘500’.
  • Lookups field s are not populated
  • Attachments are not supported
  • Any field validation needs to be implemented at the browser level using Javasrcipt.web-to-lead-22

In above lead no validation was applied to web created lead for Mobile Number and Email Id.

Note: A form may become a victim of a BOT attack, where in random – gibberish leads are created in large numbers. Use of CAPTCHA may be necessary.

Check these links that discuss how to stop spam leads:

http://salesforce.stackexchange.com/questions/23705/can-web-to-lead-be-protected-from-spammers-without-additional-server-side-process
 http://www.techguyswhogetmarketing.com/blog/2014/01/stop-spam-leads-salesforce-web-to-lead/

What Certification are you studying for now?

Focus on Force currently provides practice exams and study guides for sixteen certifications

Salesforce Web to Lead

The Salesforce Web to Lead functionality offers an easy way to get leads from your website into Salesforce. Although there are some constraints with its use, it will satisfy the requirements for many organizations. Salesforce also offers a way to associate the leads from the webpage to a particular campaign. You can also have multiple web-to-lead forms from multiple websites or landing pages, all inserting leads in Salesforce and either… Read More

Salesforce Web to Lead

Reporting on Accounts that haven’t ordered a product in the last 12 months

It is quite common for organizations to bring order history into Salesforce to add to other interactions captured in Salesforce to have a complete picture of a customer. Once the information has been brought into Salesforce, it is easy to report on account order history, but what if you would like to report on accounts that don’t have order history for a particular product in the last 12 months. This… Read More

Reporting on Accounts that haven’t ordered a product in the last 12 months

Reporting by Month and Year with Salesforce Reports

You may have the requirement to report by month and year. If you have tried that, you will find that the standard reporting features may not provide you with what you are looking for. Lets say that you would like to report on the number of closed opportunities over the last 3 years. You would like to have months reported along the top in columns and the years down the… Read More

Reporting by Month and Year with Salesforce Reports

What can you do with SalesforceA

SalesforceA was released in Spring 14 to allow Salesforce admins the flexibility to do routine user management on their mobile device. If you have ever had to immediately inactivate a user, or had to response ASAP to a user that has locked themselves out and needs a password reset, then this app will come in handy. Here is our review of what you can do with this app, what’s good… Read More

What can you do with SalesforceA

Salesforce Sandboxes

What is a Salesforce Sandbox? Although it is very easy and possible to make changes directly to configuration in Salesforce, it is a better idea to test out those changes in another environment which won’t affect your users. That’s why Salesforce includes a ‘sandbox’ for every production organisation where changes can be made and tested before moving them to production. This type of environment is called a sandbox. The number… Read More

Salesforce Sandboxes

Salesforce Quotes

Once you have added your products into an opportunity, Salesforce has inbuilt functionality to allow you to generate and email quotes to customers. Lets take a look at how this works, and what you need to be aware of when using Salesforce Quotes. First, to use Quotes they need to be enabled. By default the are not enabled and you won’t see them in your Opportunity screen. Go to: Setup… Read More

Salesforce Quotes

Salesforce Jobs

Salesforce Administrator After Salesforce is implemented, a Salesforce administrator is required to maintain and extend the system functionality as business needs change, evolve or expand into new areas of the business. The role is a varied one but will typically include some or all of the following: • Provide User Support and be responsible for user administration • Investigate and resolve problems • Investigate and analyze requests for change and… Read More

Salesforce Jobs

Salesforce Basic Terminology

If you are new to the Salesforce.com application, you may wonder ‘What exactly is Salesforce.com’ and before long you will come across some terminology that is used to describe different parts of the application, functionality and navigation.Here is a quick guide to some of the basic terminology you need to understand Salesforce.com and navigate the application.Basic SalesforceSalesforce is the name of the company and name of the application. It started… Read More

Salesforce Basic Terminology

Subtract Two Date Fields to Calculate Duration of Time

If you are faced with the challenge of calculating the duration of time between two dates in Salesforce, this post is for you. Lets say what you want is to take two dates and times, for example 20/01/2014 09:00am and 21/01/2014 10:20am and calculate the duration of time between them in hours and minutes, and display the result like this: 24:20 or 24h:20m.If we just create a formula field and… Read More

Subtract Two Date Fields to Calculate Duration of Time

Salesforce Roll-up Summary Using the Value of a Formula Field

Roll-up summary fields are a very useful Salesforce feature, but you may come across a situation where you need to rollup the value of a formula field. Here is an example: You have added a custom field to the Product object to record the cost of a product. You want the total cost of all products added displayed on an opportunity. In the screenshot below you can see Widget A… Read More

Salesforce Roll-up Summary Using the Value of a Formula Field

Saving Emails to Salesforce

If you use Gmail or another web based email service, Salesforce has a feature that will allow you to save your emails related to leads, contacts and open opportunities. It is the ‘Email to Salesforce’ features and when enabled, allows users to bcc a unique bcc email address to automatically create activity records against records in Salesforce. To use this feature, firstly the Salesforce Administrator has to enabled it, and… Read More

Saving Emails to Salesforce

Comparing Salesforce Editions

There are a number of editions of Salesforce offering varying features and capabilities. If you are new to Salesforce and deciding which edition is right for you, then this guide will be helpful. If you already have Salesforce it will be useful to know what features you can take advantage of and any limitations you will have. It is of course possible to upgrade to a higher edition. If you… Read More

Comparing Salesforce Editions

Salesforce Search Layouts

Salesforce gives up the ability to customize many areas of how it displays data. One area that is important to understand but easy to overlook is search layouts. Search layouts allow us to customize the fields both standard and custom that are displayed in various results lists. It is worth the time to customize, as it can improve productivity by ensuring that the most useful fields are displayed in the… Read More

Salesforce Search Layouts

Salesforce Instances vs Orgs vs Environments

Once you start getting involved with Salesforce, you will hear a number of terms such as Instance, Org, Environment and even POD. Its easy to get these confused or even not to even be aware of what they really mean. One person may refer to the development instance and another the development environment. Some organisations may refer to the fact that they have multiple instances of Salesforce, and another multiple… Read More

Salesforce Instances vs Orgs vs Environments