What is Web-to-Lead?

Web-to-lead generates a contact form that can be integrated within an existing website.  Each form submission creates a lead record in Salesforce.

When is it appropriate to use  Web-to-Lead?

Essentially, any time your organization wants to capture leads from a website, web-to-lead is the easiest way to do so.  For example, use web-to-lead to add a “Contact Us for Pricing” form on your existing website that creates a lead record in Salesforce for every form submission.

There are some limitations (below) that may make web-to-lead inappropriate for some scenarios.

How to implement Web-to-Lead:

Step 1. Configure the default response template, and auto-response rules.

See Lead Auto-Response Rules for detailed instructions.  This step will determine what email template the form submitter receives in reply (e.g. “Thank you for your interest.  Our team will be in touch shortly.”).

Step 2. Configure Web-to-Lead Settings.

Navigate to Setup –> Customize –> Leads –> Web-to-Lead.

12-19-2012 12-52-53 PM

The default lead creator will be shown as the lead creator for web-to-lead submissions.  Keep this in mind for reporting purposes.

Open Example

My organization runs a monthly report to calculate the number of leads created per user.  As I am the default web-to-lead user, the report shows that I am credited as the creator for all web-to-lead entries.
Step 3. Generate the web-to-lead HTML code.

Navigate to Setup –> Customize –> Leads –> Web-to-Lead.  Click “Create Web-to-Lead Form”.

Select the appropriate fields, return URL, and click “Generate”:
12-21-2012 5-28-16 PM

Step 4. Customize your web-to-lead HTML code.

The HTML code generated from Salesforce does not contain any validation or styling.  Therefore it must be customized to include CSS, styling elements, form validation (see below), hidden fields (see below), and so on.  This customized code is ultimately what is deployed on your organization’s website.  The web-to-lead code generated by Salesforce is simply a starting point.

In many organizations, this step is performed by the web development team.

Limitations and other considerations for Web-to-Lead:


You cannot capture lookup relationship fields with web-to-lead, with the exception of the Campaign field.  When the campaign field is included with a web-to-lead submission, the lead will be automatically joined to the specified campaign.

You may want to hard code the campaign ID into your web-to-lead form (this way the submitter of the web-to-lead form does not see the campaign field).  In that case, use the following code (replace “701E00000000xE0″ with the appopriate campaign ID in your org):

<input type=”hidden” id=”Campaign_ID” name=”Campaign_ID” value=”701E00000000xE0″ />


The web-to-lead form generated by Salesforce does not restrict data entered into the form.  Any validation (such as requiring fields, or a valid email address) must be added to the generated HTML code; this validation cannot be configured within Salesforce.

Open Example

I create a web-to-lead form with fields FirstName, LastName, Phone, Company, and Email.  I can submit a web-to-lead entry with all of the fields blank:

12-19-2012 1-21-02 PM

To require these fields, the HTML code will need to be updated.

Daily Limits:

By default, you can capture up to 500 web-to-lead submissions per day.  If your organization wants to capture more than 500/day, you can contact Salesforce to have the limit increased.  Or, use another method to capture leads.

51 Responses to “Web-to-Lead”

  1. mengqinas June 9, 2017 at 2:36 am #

    Regarding “You cannot capture lookup relationship fields with web-to-lead”, can HTML code do something like below to keep the lookup relationship?


    ProductID and ServiceID are hard-code based on Type table(parent table) ID value, inspired by your hard-code campaignID.

    • JohnCoppedge June 9, 2017 at 11:47 am #

      You could capture an id in a hidden text field and then convert to a lookup using process builder

      • mengqinas June 9, 2017 at 7:05 pm #

        You are so cool!

        I build a process with below parameters for update record:

        Field: opportunityType Type:ID Value: a096A000000JQxR

        In this case I can update AccountID/OwnerID etc., whatever shows up under field.

        • JohnCoppedge June 9, 2017 at 9:48 pm #

          Nicely done! 🙂

          • mengqinas June 9, 2017 at 11:53 pm #

            After I pass the exam, I am going to hunting a job as Salesforce admin. Wish me have another nicely done!

  2. siddharth1101 May 24, 2017 at 12:28 am #

    Hi John,

    Few syntax issues with your Hidden Campaign code, this one worked for me:

  3. els9 May 23, 2017 at 3:09 pm #

    Hello, I am excited to put this in use for an organization. However, I’m getting stuck with the Enable spam filtering (recommended), reCAPTCHA API Key Pair. I have a screen shot, but can’t seem to upload an image in this comment. Could you add instructions to this lesson about how to deal with the reCAPTCHA API Key Pair?

    • rishabhsrana August 9, 2017 at 12:34 am #

      The way to proceed as of now for learning purpose is to Disable spam filtering (I saw it somewhere on the internet).

  4. pundlik.amruta@sfdc.com October 25, 2016 at 6:28 am #

    Hi John,
    Sorry to ask a very basic question…
    I created a new web-to-lead form in my Salesforce org. Now how to I start/access/see the form ?
    please help..

    • JohnCoppedge October 26, 2016 at 12:31 pm #

      You have to save the form as HTML and open it in your browser (the idea being that you would later deploy this to your website)

  5. marshal.hakikat@gmail.com March 14, 2016 at 7:56 am #

    Hi John..can you please explain the below
    A company has leads that come from different languages and the VP of sales want to respond to them in there own language.
    how as a Admin would you do that?
    1. create multiple email templates and use a auto response rule to filter the critera to do that.
    2. create multiple email templates and use a workflow action
    3.create multiple email templates and use a vailation rule
    4. make 1 template and use the translation workbench to translate it into there language.

    I assume the answer to be 4.but this question is discussed previously in this discussion board and option is 1 suggested by you..
    Can you please explain why we can not use option 4

    • JohnCoppedge April 11, 2016 at 12:11 am #

      Yep – translation workbench can translate pick list values and field labels, etc but not email templates

      • Sarah Ross August 11, 2016 at 10:54 pm #

        So confused. When this question was first posed I thought the answer was 4 but you said it was 1. Now you say it is 4… This was on my exam too and now I don’t know which one is right.

        • Sarah Ross August 11, 2016 at 10:55 pm #

          Nevermind. I read that wrong. That was an explanation for why 4 was wrong. I understand now. Sorry!

  6. racerxx1969@hotmail.com October 28, 2015 at 4:23 pm #

    John I tried the web to lead form from another computer. I was able to generate the lead record as expected. I ran across the following youtube video on how to hack the api running from the browser which helped in the debug. https://www.youtube.com/watch?v=w6o1JxhTJr8.

  7. cbi September 26, 2015 at 8:17 am #

    Hi John,
    Is the limit “500 web-to-lead submissions per day” valid for Spring’15? (Are there no 3000 submissions web-to-lead per day possible?)

  8. Kevin Brown March 5, 2015 at 7:38 pm #

    Minor (“each” is singular):

    Each form submission create a lead record

    …should read

    Each form submission creates a lead record

  9. Alexander Goodman December 9, 2014 at 8:39 pm #

    I have just failed the ADM 201 a 3rd time and wanted to ask about a lead based question, which was roughly:
    A company has leads that come from different languages and the VP of sales want to respond to them in there own language.
    how as a Admin would you do that?
    1. create multiple email templates and use a auto response rule to filter the critera to do that.
    2. create multiple email templates and use a workflow action
    3.create multiple email templates and use a vailation rule
    4. make 1 template and use the translation workbench to translate it into there language.
    I choose 1 (there not in the same order and the question was worded similarly)
    which was the right one and why?
    I choice 1

    • JohnCoppedge December 10, 2014 at 4:14 pm #

      1 sounds correct to me as well.

      Do you know where else you may have fallen short on the exam? Would love to steer you in the right direction if I can.

      • Alexander Goodman December 10, 2014 at 5:17 pm #

        I think so, Visual flows, activity object and the dashboard componants as well as the connections between the standard objects, I am also struggling with case management. also when cross object formulars are needed. Thats all I can remember and I am going for it next Thursday (the 18th). if you can help I would appecate it.

        • JohnCoppedge December 14, 2014 at 7:31 pm #

          (replied offline)

        • Violet kharadabineh January 1, 2015 at 10:04 pm #

          Hi Alex, when you took the exam again on the 18th was it the same? Or different questions? I failed my first exam too and contemplating about taking it soon or study more.

      • Gautam Kasukhela February 1, 2016 at 3:15 pm #

        Hello John,
        How can it be the first option here, does auto response rules not have a limitation of having only one active rule at any given point of time? So only one template (considering it corresponds to one language template) can be linked to an auto response.
        Correct me if I am wrong.


  10. Odelya Bouganim December 6, 2014 at 3:30 pm #

    Hi there and thanks for a great website…

    I have a general question :

    what are the boundaries of lead management in Salesforce VS. targeted online marketing tools, like exact target or Marketo?

    How both can be combined? can Salesforce replace Marketo ? how both can work together?

    Thanks !

    • JohnCoppedge December 8, 2014 at 4:20 pm #

      They work together – Salesforce has the “Marketing Cloud” as well, which competes with Marketo (they bought and integrated Pardot some time ago).

      Generally speaking, web to lead is a simple tool that would be replaced with a full scale marketing automation tool such as Marketo. They can work together, but typically do not.

  11. Chuck Fernald June 23, 2014 at 5:07 pm #

    We use B2B and B2C sales processes and associated record types with W2L as one channel. In the master picklist for Lead Status in the lead object, the default is “Open”. However, I’ve defined a default lead status for each record type that is different from the default in the master list (in fact, I’ve removed the master list default from the lists for each record type). When I create leads manually this process works as expected. But when I capture leads via W2L, the created lead always has it’s status set to the default in the master list, not the default status I’ve defined for the record type (which is hard coded and hidden in the W-2-L form, depending on the page visited). How do I force the default lead status for a W2L record?

    • JohnCoppedge June 24, 2014 at 2:09 pm #

      Hey Chuck,

      Either set the status within a hidden value on the w2l form, or use a workflow rule to automatically change the status based on the record type. Cheers,


      • Chuck Fernald June 30, 2014 at 4:55 pm #

        FWIW, according to SFDC tech support (and my experience), W2L only uses the lead status default value from the master picklist for the lead object, even if you try to define it with a lead status recordID (hidden or not) at the time of the W2L submission. So it appears the only solution for this is workflow rule. Thanks, Chuck

        • JohnCoppedge July 8, 2014 at 8:22 pm #

          Thanks Chuck, that’s good to know. I haven’t run into that specific scenario before!

  12. Tasnim Tailor June 18, 2014 at 3:10 pm #

    Do validation rules on Lead object run while creating a lead through Web-to-Lead form?

    • JohnCoppedge June 18, 2014 at 3:24 pm #

      Yep – https://help.salesforce.com/HTViewHelpDoc?id=fields_validation_considerations.htm&language=en_US

      Salesforce runs validation rules before creating records submitted via Web-to-Lead and Web-to-Case, and only creates records that have valid values.

      You will generally want to structure your web to lead forms to avoid validation rules.

      • x x December 12, 2014 at 9:41 pm #

        Considering the following scenario:
        1) a web-page visitor submits and empty Web-to-Lead form
        2) there are some Validation Rules in place that prevent storing an empty Lead in Salesforce
        3) hence, no Lead is stored

        Is the web-page visitor notified at all? I presume, he’s not.

        Meaning that I should supply HTML/JS validations for the form on the web page that double the checks done by the Validation Rules.

        Thank you

        • JohnCoppedge December 14, 2014 at 2:49 pm #

          The salesforce admin gets an email with the details filled out in the form, so the information can be captured manually. As no lead is created in the system, the lead would not get an email (unless entered manually by the admin and then sent).

      • Jessie Rymph March 19, 2015 at 10:18 pm #

        John, Can you explain the difference between this and your explanation above about Validation: “Any validation (such as requiring fields, or a valid email address) must be added to the generated HTML code; this validation cannot be configured within Salesforce.”
        Are you saying the person completing the form won’t be restricted in any way by validation rules, but the data won’t be entered into a record?

        • JohnCoppedge March 22, 2015 at 4:41 pm #

          When SalesForce generates an HTML form, the data entered into that form is not validated. However, once the form is submitted validations rules are still evaluated – if the form entry is invalidated then the lead is not created and the admin is emailed with the form details. Therefore it is important to add any validation to the HTML to ensure that your HTML validation matches any validation rules.

  13. Devdatt Chudasama May 30, 2014 at 1:06 pm #

    Web development team who is going to validate and enhance Web Form can ensure that Required Field in Lead Object does not come empty from Web From.

  14. Kaira Bergstra January 14, 2014 at 4:53 pm #

    What happens if a field is required on the Lead object but comes empty from the web form? Is the Lead still created?

    • JohnCoppedge January 16, 2014 at 11:50 pm #

      I’m not %100 sure – I believe if the field is required (at the field-level, not page layout), then the lead is rejected. The admin will get an email notification with the data within the web form when this happens (a failed apex trigger will cause this, for instance).

      • Mahesh Mudigonda February 12, 2016 at 10:38 pm #

        Did a quick test, Looks like the lead record will be created even if the required field is not populated on the web to lead form, however salesforce generates an error if a user tries to edit and then save the lead record without the required field populated.

        • JohnCoppedge February 17, 2016 at 1:54 am #

          Correct- if the field is required on the page layout.

          If it were required at the field level, then I think it would reject. Some fields get auto-populated as well (for example if you leave company name blank, I think it adds a value for it). The logic on web-to-lead is not as straightforward as you might think…

  15. Taurean Sutton December 31, 2013 at 6:52 am #

    This is a problem with the CSS in the template that you are using in WordPress. It is currently defined as:
    -webkit-hyphenate-character: “2010”;

    If you would like to fix this, I would most likely override the theme by using the custom.css option and define the following as the default theme does not include the beginning backslash:

    -webkit-hyphenate-character: “\2010”;

    • JohnCoppedge January 16, 2014 at 11:48 pm #

      Thanks – I recently updated a plugin that should have fixed this. Do you still see the problem?

      • Silvestre Tanenbaum September 4, 2014 at 7:53 pm #


        The problem is still visible. I’m running Safari on OS X 10.10, if that helps.


  16. Chris Eley December 10, 2013 at 3:37 pm #

    the lead will automatically be joined to the specified campaign. – something is going on with the formatting on the page, I’ve looked on my mac and my work PC. the word automatically has a 2010 right in the middle of it like this “auto2010matically.” It’s very odd. Just a FYI.

    • JohnCoppedge December 13, 2013 at 6:20 am #

      Thanks Chris – seems to be a Safari/Apple issue from my experience. Working on tracking it down. Chrome should work as an alternative.

Leave a Reply