It is often said that the first thing you need when getting started with Salesforce.com marketing is a web-to-lead form. Why is it your first step as a marketing professional?
Web-to-lead is an out of the box functionality where you can create a registration form that inputs the contacts who fill out the form directly into salesforce as leads.
On this form you can capture as many fields as you like and also setup an auto response email that goes out after someone registers on the form.
Forms are used for many different marketing campaigns (example: Webinar registration, Software download, event sign up) which is why its is important to associate each web-to-lead with a separate campaign.
Before you get started with creating a web-to-lead form you need to have the following in place:
- Create a lead assignment rule to determine who the leads should be assigned to.
- Create any custom field you would like to capture on the form.
- Create public email templates you can use for auto response.
- Create a campaign and customize the member status values if needed.
- Get the Campaign ID from the url. Example: https://na2.salesforce.com/70140000000I8TH The part after the / is your campaign ID.

Creating the Web-to-lead and attaching the campaign:
Step1:
Go to Setup | App Setup | Customize | Leads | Web-to-Lead.
Step 2:
Select the fields you would like to capture on your form.
Make sure to include “Campaign and “Campaign Member Status”
Step 3:
Click on Generate button to get the HTML code of the form. The HTML will show you the list of your available campaigns and their IDs. Select the one you want out of that list.
Step 4:
Add the following code to the HTML form

<input type=”HIDDEN” name=”Campaign_ID” value=”70140000000I8TH
“></select><br>

<input type=”HIDDEN” name=”member_status” value=”responded”>

Adding this code to the HTML form will ensure that every lead that fills out the form will be attached to the campaign you assigned and the member status default you designated.