Salesforce for Google AdWords Blog

Web-to-Lead Form Validation

Nobody gets excited about dirty data in a CRM implementation.  One great way to keep your data clean is to implement client-side javascript validation with your web-to-lead forms.  This is a valuable technique for ensuring that a user completes certain required fields before they can submit your form.   Just be careful not to overdo it, implementing excessive form validation will annoy users and cause your conversion rates to drop, so consider any client side validation alongside your marketing objectives.

Web_to_lead_form_validation_3

The Web-to-Lead Validation Call

Simply add the following onsubmit function call to your existing Salesforce web-to-lead forms as shown by green text in the example below.  Please note that other javascript functions (such as placing an onclick function on your submit button) are not certified.

       

<form action="https://www.salesforce.com/servlet/servlet.WebToLead" method="POST" onsubmit="return validation(this);">

      

<input type=hidden name="oid" value="insert_your_oid_here">
<input type=hidden name="retURL" value="http://www.company.com/thanks.html">

      

<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>

      

<label for="last_name">Last Name</label><input id="last_name" maxlength="40" name="last_name" size="20" type="text" /><br>

      

<label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br>

      

<label for="company">Company</label><input id="company" maxlength="40" name="company" size="20" type="text" /><br>

      

<input type="submit" name="submit">

      

</form>


The Validation Function
Then include a javascript validation function, either directly in your HTML header or by reference.  For example:

       

function validation(form) {
      
      
if(form.first_name.value == '') {

alert('Please enter your first name');
form.first_name.focus();
return false;
}


if(form.last_name.value == '') {

alert('Please enter your last name');
form.last_name.focus();
return false;
}

if(form.email.value == '') {

alert('Please enter your email address');
form.email.focus();
return false;
}


if(form.company.value == '') {

alert('Please enter your company');
form.company.focus();
return false;
}

return true;
}


Certififed with Salesforce for Google AdWords

The techniques noted here are supported with standard web-to-lead forms and are certified not to conflict with the website tracking provided by Salesforce for Google AdWords.  As always, please contact us with questions via email: sfga (at) salesforce (dot) com

Search Campaign Success with Google AdWords

The Salesforce for Google AdWords hands-on lab was one of the most impacted sessions of Dreamforce 2007.  Unlike many of the track sessions which will be posted to YouTube and/or Google Video this week, a hands-on lab doesn't lend itself well to an exciting video replay.  However, many folks have asked for a copy of the slides that were used during the hands-on lab, which you can now download here:

Acrobat_1 Download: Hands-On: Search Campaign Success with Google AdWords (2MB PDF)

Dreamforce_2007_adwords_training_cl

Special thanks to Sean Whiteley for leading the session, and to the amazing team of Google AdWords gurus that delivered killer content: Ty Heath, Kristina Cutura, and Justin Vinluan (pictured above from right to left)

Get Your Dreamforce On

Dreamforce 2007 is upon us, officially kicking off tonight at San Francisco's Moscone Center.  We had an amazing turnout this Sunday evening in the Salesforce/Google campground.  Check out Sean Whiteley drawing a crowd as he demonstrates Salesforce for Google AdWords in the campground theater...

Df07_camp1

    ...while Google and Salesforce representatives answer questions on the expo floor

Df07_camp2

If you're planning to attend the conference, be sure to check out all of the track sessions showcasing Saleforce for Google AdWords:

Monday 11:30am - Marketing in the Google Era
Monday 5:00pm - Your Website, The Hub of Marketing
Tuesday 11:15am - Hands-On Lab: Salesforce for Google AdWords
Tuesday 3:45pm - Salesforce for Google AdWords, The Basics
Wednesday 9:00am - Advanced Search Engine Marketing

Additionally, Jeff's post over on the Google Enterprise blog outlines the expanded areas of Salesforce/Google collaboration including website analytics, mash-up development, google apps demos, and announcements of new, new, new appexchange mashups.

See you tomorrow!