Enable Web-to-Lead in Salesforce
Web-to-Lead lets you capture form submissions from your website and automatically create Lead records in Salesforce. Before you can use it, the feature needs to be turned on in your org.
- Go to Setup in Salesforce (gear icon → Setup).
- In the Quick Find box, type "Web-to-Lead".
- Click Web-to-Lead under Marketing.
- Click Edit and check Enable Web-to-Lead.
- Set your Default Lead Creator (the user who owns leads when no assignment rule matches).
- Click Save.
That’s it — your org can now accept web leads. The default daily limit is 500 leads; contact Salesforce support if you need more.
Configure Your Lead Fields
Decide which fields your form should capture. At minimum, you need an email address — but the more context you collect upfront, the faster your sales team can qualify the lead.
Common fields:
- First Name / Last Name — basic identification
- Email — required for follow-up
- Company — helps with account matching
- Phone — for high-priority leads
- Lead Source — set as a hidden field (e.g., "Website Contact Form") so you can track where leads come from
You can also map custom fields. Every custom field you create on the Lead object gets a unique field ID you can use in your HTML form.
<!-- Example: hidden Lead Source field -->
<input type="hidden" name="lead_source" value="Website Contact Form">
<!-- Example: custom field (use the field ID from Salesforce) -->
<input type="text" name="00N5e00000XXXXXX" placeholder="Budget Range">
Set Up Auto-Response Rules
Auto-response rules send an automatic email to the person who submitted the form. This confirms their submission was received and sets expectations for follow-up.
- Go to Setup → Auto-Response Rules (under Marketing).
- Click New Rule and give it a name (e.g., "Website Lead Response").
- Set it as the active rule.
- Click into the rule and add Rule Entry Criteria. For a catch-all response, set the criteria to "Lead Source equals Website Contact Form".
- Configure the email template — include a thank-you message, expected response time, and any helpful links.
- Set the From email to a monitored address (not noreply@).
Pro tip: Create multiple rule entries with different criteria to send personalized responses based on the lead’s industry, location, or product interest.
Build and Test Your Form
Your Web-to-Lead form is a standard HTML form that POSTs data to Salesforce’s servlet endpoint. Here’s what a minimal form looks like:
<form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type="hidden" name="oid" value="YOUR_ORG_ID">
<input type="hidden" name="retURL" value="https://yoursite.com/thank-you">
<label for="first_name">First Name</label>
<input type="text" id="first_name" name="first_name">
<label for="last_name">Last Name</label>
<input type="text" id="last_name" name="last_name">
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<label for="company">Company</label>
<input type="text" id="company" name="company">
<button type="submit">Submit</button>
</form>
Test Your Setup
Before going live, test the full flow end to end:
- Submit a test lead using a personal email address. Check that the Lead record appears in Salesforce within a few minutes.
- Verify field mapping — make sure each form field maps to the correct Lead field.
- Check auto-response — confirm the acknowledgment email arrives and looks correct.
- Test the return URL — after submission, you should be redirected to your thank-you page.
- Test assignment rules — if you have Lead Assignment Rules configured, verify the lead is routed to the right owner.
Common issues:
- Lead not appearing: Double-check your Org ID (
oidfield). It’s the most common mistake. - Wrong field values: Ensure
nameattributes match Salesforce’s expected field names exactly. - Hitting daily limit: Salesforce caps Web-to-Lead at 500/day by default. Leads beyond the cap are queued, not lost.
Deploy to Production
Once testing passes, deploy your form to your live website:
- Add the form HTML to your contact page, landing page, or wherever you want to capture leads.
- Style the form to match your website’s design. The form is plain HTML — style it with your existing CSS.
- Add spam protection. Consider adding Google reCAPTCHA or a honeypot field to prevent bot submissions.
- Set up monitoring. Create a Salesforce report or dashboard to track new web leads by day/week.
- Notify your sales team. Set up email alerts or Slack notifications so leads get followed up on quickly.
Your Web-to-Lead pipeline is now live. Every form submission creates a Lead in Salesforce, triggers an auto-response, and routes to the right rep.
Need Help With the Full Setup?
We can configure your entire Web-to-Lead pipeline — assignment rules, auto-responses, scoring, and alerts.
Auto Lead Assignment
Route leads to the right rep automatically based on territory, product interest, or round-robin rules.
Lead Scoring Rules
Score and prioritize leads based on form data, engagement, and fit — so sales focuses on the best prospects.
Email Alert Setup
Trigger instant email notifications to your team when a new lead comes in — never miss a hot prospect.