Published June 14, 2024 by David Hecht
Last Updated October 29, 2024
Want more leads? Of course you do! Everybody needs to receive inquiries from prospects and customers, whether you are a large business or a small nonprofit.
When you are first implementing Salesforce, one of the decisions you’ll need to make is how to efficiently get inquiries from your website into Salesforce, so communications can quickly be managed in your CRM. Same for when you are redesigning your website, or trying to figure out how to make your Contact Us page or advertising landing page more compelling to prospective customers.
Salesforce uses Leads as the record to separate prospects interested in your product or service from your customers. In the Salesforce data model, once Leads are qualified, you convert them to an Account with a Contact, and optionally an Opportunity.
One of the easiest ways to get these inquiries into your Salesforce account is a feature called Web-to-Lead (sometimes abbreviated W2L). And the good news is that this technology is already included in your Salesforce Sales Cloud or Service Cloud subscription.
In this ultimate guide to Salesforce web-to-lead forms, we will cover the following:
Salesforce web-to-lead is an included feature in Salesforce Sales Cloud. By turning it on and going through the steps below, you can quickly generate a form to place on your website, where customers or prospects who fill out the form instantly appear in Salesforce as leads.
By having leads automatically created in Salesforce, instead of sent via email or stored elsewhere, you can get better data on your prospects — who they are, where they came from, and more.
Web-to-Lead ensures no data is lost, you get better reporting on lead flow, and no manual data entry is required of your sales people. It also enables you to easily kick off automations in Salesforce, such as email autoresponders, automated lead assignment to Salesforce users or queues, and more.
Web-to-Lead is one of the first steps to generating leads, and managing them in Salesforce!
There are many advantages to using Salesforce Web-to-Lead Forms, as it is the included technology that has been provided as part of Salesforce for more than 20 years.
We’ve seen some of the advantages of Salesforce web-to-lead above. So why are there so many dozens of form applications out there, offering alternatives to a feature that is included with Salesforce? Here are some of the disadvantages of Web-to-Lead, and why customers might turn to third-party forms like Formstack or FormAssembly.
There are a few things to consider, when preparing to set up Salesforce web-to-lead. These items can always be updated after implementation, but thinking them through ahead of time will make your go live process smoother.
Who will own new leads, and how will they be assigned?
This may be simple if you only have a single person responding to inquiries, but for larger sales organizations there are a number of Salesforce features that can make lead follow up more efficient and organized.
Leads can be automatically assigned to Salesforce users based on various rules and the data submitted via the form, or assigned to a Queue for distribution.
In addition, there is a “Default Lead Creator” setting in Salesforce, where all leads that come in via Web-to-Lead forms will show up as having been created by that person. There is also a default Lead Owner setting, so if you do not set up lead assignment rules, all web-created leads will be assigned to the default owner.
Most lead forms are kept simple and short, using existing fields already provided by Salesforce. First Name, Last Name, Company, Email, etc.
But if you would like to track information specific to your business, it is easy to create custom fields in Salesforce. Perhaps you would like to add a picklist field for your leads to select which of your products or services a lead is inquiring about, or add fields for a lead to request a quote.
Creating custom fields ahead of time will make them available when you create your web-to-lead form, as well as improve the data you receive in Salesforce. You can also use information specific to your business to help drive lead assignment or auto-responses, based on product interest or different sales teams.
You can create Salesforce web-to-lead forms in just a few simple steps. First you will enable the basic feature and choose its default settings, and second you will create a form.
Guidelines for Setting Up Web-to-Lead
Generate Leads from Your Website for Your Sales Teams
There are a few parts of the web-to-lead code you might wish to understand as a marketer, but certainly should as a web developer.
Feel free to skip this section if the underlying code is not of interest!
To create additional web-to-lead forms, you can generate them using the same process above, or simply copy and edit the code as needed to remove or add fields. If you are going to do the latter, you should understand the following pieces of code:
The first line in your Salesforce web-to-lead form tells Salesforce to post the data to a Salesforce endpoint.
<form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
This should always be the same (unless you are using Marketing Cloud Account Engagement (fka Pardot), in which case you might update it with a Pardot Form handler URL in cases where you wanted Leads to first go into Pardot).
The second line in your form is the oid, or Salesforce Organization ID. This defines the target Salesforce account where leads should be posted to, so it is very important.
<input type="hidden" name="oid" value="00Dd0000000fbft">
This value should not be changed, unless you wanted to create a test form that posted to a different Salesforce org, such as a Developer org or Sandbox org for testing. In that case, you could change the value to the 15 character org ID of the new target Salesforce account.
The retURL is where you want website visitors to end up after submitting the form. Simply update the value to direct people to a different page.
<input type="hidden" name="retURL" value="http://www.cloudamp.com/contact/thanks.html">
While some companies redirect to their home page after form submission, using a dedicated thank you page is a best practice. That allows you to have a thank you message indicating next steps, as well as hidden conversion tracking codes for Google Ads or other online advertising, since visitors should only be arriving at this thank you page after a conversion (submitting the form).
The final input is a submit button, which is what website visitors click on to submit the form. You can change the value here as well to a more compelling message, such as “Get Started” or “Download Now” etc.
<input type="submit" name="submit" value="Get Started">
This input will almost certainly be styled by your web developer to match your site, which is what we cover in the next section!
👍 Protip:
Want to automatically assign new leads to a Campaign? Our guide to identifying “Which Form or Web Page did a Salesforce lead come from?” provides a how to on hard-coding Campaign values in a hidden field in your web-to-lead forms, so new leads automatically get assigned to those Salesforce Campaigns. |
Once you have generated the Salesforce web-to-lead code, there are two basic steps to implementing them on your website:
There are two missing pieces in the web-to-lead code provided by Salesforce:
Formatting the layout of the form on your web page is needed because the HTML code generated by Salesforce does not include any styling, so the fields don’t align properly, looking a bit jumbled. So some CSS code is definitely required to make it look decent.
If you have a web developer that you work with, it should be a relatively small project for them to format the form for your website. Send them the HTML code that Salesforce generated, and they can add some brand colors and fonts to the form title and submit button, and arrange the form fields so it looks more professional.
On the data validation side, it is not required, but some organizations will want to add validation to the form. Common use cases are requiring a properly formatted email address or requiring that certain fields be filled out to submit the form. Your web developer should be able to add some basic javascript validation to the form, though this is not necessary for most lead generation activities in our opinion.
While AI has its limitations, you can cut and paste the form code into ChatGPT and ask it to format things in different ways. It is very capable of adding some basic CSS width and alignment parameters and javascript validation quite quickly.
One current limitation of ChatGPT is that as a text-based AI model, it will not render (display the output) of the HTML code it generates. So you will need to take its output and load it separately in a browser to see how much it has improved things.
Testing your Salesforce Web-to-Lead forms is one of the most important steps, and is recommended for every single form you implement (as well as any time you make a change to a form!)
After all, if your forms are not working properly, you can lose a large volume of potential business. And worst of all, you may not know anything is wrong right away, as form submits on a broken form may just not work, with nothing coming into Salesforce and no errors apparent to you or the prospect.
So testing is absolutely critical, to avoid lost business and unhappy prospects wondering why they never heard from you.
The good news is that testing your web forms is easy, and tools are already built in. There are two basic ways to test your form:
👍 Protip:
If this is your first time implementing web-to-lead, we recommend creating a test page for your form, which is not linked to the rest of your web site. That way customers won’t stumble across it during your testing, and you won’t cause any disruption to your contact us or other important forms until you are tested and ready to go live. |
When you generate the HTML code from Salesforce, you may notice a section at the top for debugging:
<!-- ---------------------------------------------------------------------- --> <!-- NOTE: These fields are optional debugging elements. Please uncomment --> <!-- these lines if you wish to test in debug mode. --> <!-- <input type="hidden" name="debug" value=1> --> <!-- <input type="hidden" name="debugEmail" --> <!-- value="<<add emailId here>>"> --> <!-- ---------------------------------------------------------------------- -->
This code will allow you to have the form submissions emailed to you as a test, instead of going into your Salesforce org. So it is very useful when you are first testing Salesforce web-to-lead.
To test using debug mode:
Now when you submit the form, it will send you an email with the output, instead of creating a lead in Salesforce.
Once you have tested your form, you should remove these lines, or re-comment them and delete your email address, prior to going live.
Testing your forms outside of debug mode is the most important test. That way you can ensure leads are correctly making it into your Salesforce org, as well as confirm that any lead assignment rules or auto-responses are working as expected.
When submitting test leads, here are a few recommendations:
👍 Protip:
If you are using Gmail or Google Suite for your email, you can create unique email addresses that still go to your inbox by adding a + and additional text between your name and the @ sign. Google ignores anything between the + and @, so you can create unlimited unique emails for testing in the format bob+test123@test.com |
Once you have submitted a few test leads on any new or updated form, simply navigate to the Leads tab in Salesforce and review the records. Ensure that all the data being collected on the form made it successfully into Salesforce, and that any ownership changes and automations happened as expected.
You are now ready to go live with your Salesforce web-to-lead forms!
Now that your forms are live, there are a few things to keep in mind around using Leads in Salesforce. Here are some frequently asked questions around Salesforce Leads to get us started:
Yes, you can put the Salesforce web-to-lead code on as many pages of your site as you would like. You can also create shorter forms for advertising landing pages by removing certain fields from the HTML code, or longer forms by adding custom fields such as for a request a quote form.
All web generated leads will show up as created by the default web-to-lead user that you set. You can also set certain lead sources in the form code, or automatically add leads to a certain campaign (see our protip above). But by default there is no unique source or indication of web generated leads.
When a lead is assigned, it is marked as “Unread” until its owner views it. So there will be a check mark on the Unread column on lead list views.
Your Salesforce administrator can set up lead assignment rules, to automatically route new web form leads to different users, or queues where they can be manually assigned from. If you do not set up lead assignment rules, or none of the criteria match to assign a lead, the lead will be owned by the Default Lead Owner in the lead settings.
All new leads from your web-to-lead forms will have the status equal to the “default status” that is defined by your Salesforce administrator in the Lead Status picklist values. The standard default status that Salesforce comes with is usually “Open.” Most organizations will want to customize the lead status picklist values to match their lead qualification follow up process.
In the last section of our ultimate guide to Salesforce web-to-lead forms, we’ll explore some of the ways you can add marketing, sales and demographic data to your Salesforce leads.
Data enhancements include the following options:
The Lead Source field in Salesforce is populated by some integrations with Salesforce. You can also hard code this value in a hidden field in your forms, if you want:
<input type="hidden" id="lead_source" name="lead_source" value="Whitepaper Download Page">
By adding this hidden field above, the Lead Source will effectively show you the form source, eg. what page the lead was on when they submitted the form. So it is slightly different from a Lead Source that might show the original source of how a lead found your website, but still useful in many contexts.
Most organizations find it useful to ask prospects “Where did you hear about us?”, either in a form or on the phone. Phone conversations typically produce better data, as rapport can be established and follow up questions asked if necessary.
Our recommendation is to track “Where did you hear about us?” in a separate custom field in Salesforce, to differentiate it from Lead Source or other fields that might be populated via website tracking technologies. Self-reported data from prospects can be useful, especially in gauging mindshare from consumers or the various ways they become aware of your business.
However, this data often will not agree with what web analytics show, and may have a tendency to give more credit to popular services that people commonly use and think about (eg. Google).
Because self-reported data can be unreliable, with a tendency to overweight media that consumers have a lot of exposure to (Google searches, retargeting ads, billboards), it is important to consider self-reported data alongside website tracking data.
There are a number of technologies for Salesforce that can capture precise website lead paths — how a visitor arrived at your website, which keywords they searched for, and what advertising campaign they responded to.
Salesforce’s Marketing Cloud Account Engagement (formerly known as Pardot) is a large platform that can provide you with a lot of enhanced data about your prospects. But there are also a number of lower cost, quicker to implement third party apps available, such as our CloudAmp Campaign Tracker.
Using an app like the Campaign Tracker, you can capture all of the information about how your leads found you, straight into Salesforce. Know which sources, campaigns, and marketing content drove each particular lead, as well as keywords from paid search advertising.
In addition, you can see which pages on your website a lead visited prior to submitting your web form. For many businesses, this information can be useful to understand buyer intent or product interest.
There are a number of services for Salesforce that can help fill in missing information on your leads, for better lead scoring and routing. This gives you more complete data, allows your web-to-lead forms to be shorter in many cases, and saves your team the time and effort of manually doing the research and updating Salesforce.
Services like Zoominfo and Clearbit can automatically append data to your leads, filling in blank fields such as industry, location, revenue, job title, social media handles and more.
Now you know how to create Salesforce web-to-lead forms and customize the data collected to suit the needs of your business.
Up next, you might be interested in one of our related articles, How to get a detailed Email about every new lead in Salesforce or Which Form or Web Page did a Salesforce lead come from?
There is a lot to cover in terms of how to manage leads in Salesforce, from lead assignment to scoring and different processes for qualifying and converting Salesforce leads. Stay tuned for our next installment of this series coming soon, The Ultimate Guide to Salesforce Lead Management. We hope to see you then!
CloudAmp Apps for Salesforce |