Free Tool: Create a Lead Capture Form That Connects Facebook to Your Website

Update: Facebook’s move to enable page tabs based on HTML iframes rather than FBML makes the specific techniques discussed below obsolete. Today I recommend instead using my Facebook Tab Manager for WordPress if your site is on WordPress. If you are not on WordPress, you should find that the task of integrating custom content including contact forms is now easier, overall.

A lead capture form people can submit within a Facebook page. Showing the confirmation message that appears after you click Submit

This is a simple code generator to produce a sales lead capture form to be embedded in a Facebook page.

For background on why this is a good idea, see Facebook Ads Should Point to a Facebook Page (Not an External Web Page) and the column that followed. The code generated by this tool is derived from George Huger’s Submitting a Contact Form via AJAX From Your Facebook Page. Huger shows how to use JavaScript functions that are approved for use within Facebook to submit a data entry form from within Facebook, have it processed on your web server, and get back an acknowledgement you can display on your Facebook page – without ever making the user leave Facebook and go to your website.

What I’ve done here is try to automate the process of creating a Facebook-compatible block of code that you can add as a tab on your Facebook page using the Static FBML tool provided by Facebook. This is a hack, but it works. Submit the form below, and you’ll get the FBML for the form, sample MySQL create table code for storing the data, and a sample PHP script for storing the data in the database. The PHP sample uses WordPress database routines, but you can substitute the database framework of your choice.

This is set up to be a sales lead capture form, but it can be modified to serve as the starting point for any data entry application you might want to make available to Facebook users. I welcome feedback from Facebook developers who can recommend ways this could be improved to be more functional or secure.

Of course, the server side of the equation doesn’t necessarily need to be PHP / MySQL. You could also use this tool to create a front-end data entry form to an existing web app written in any language, as long as the HTML/FBML form fields match your database schema and your server script can echo back an appropriate AJAX-style response.


Leave a Reply