like gated facebook page

Facebook is a great tool for companies, it allows them to have conversations with fans, as well as give a more personal feel and voice to the company. One of the biggest tactics on Facebook for a company is a “Like” campaign. This is where you create a tab that holds special content or a contest for those who like the brand. It’s a simple concept – show “Like” content and “Non-Like” content depending on if a user likes the brand or not.

When Facebook changed their pages and tab structure they killed off FBML in favor of iFrame based tabs. This gives us the developers much more control over what we can do. In fact its basically like displaying a site in facebook. They also provided Facebook Connect, a way of using their data in your applications.

Prior to the switch the markup was quite simple

This is great you think, and you go to their site to begin learning about their API’s. Suddenly you realize when testing their code, that it doesn’t work, and their documentation is to say the least not quite complete. After Googling you think you’re on the right track but in fact you’re just going in circles.

A versioned Facebook page in theory should be easy, and Facebook gives you a starting place, but they are very vague on the full details.

FBVersion is an easy to deploy php application that allows you to quickly set up and create “like” vs “non-like” content for you Facebook application.

The basics are this -

base_facebook.php – Base for the Facebook SDK
facebook.php – this is the SDK from Facebook it has all of the methods you’ll need to connect and get information from Facebook.
index.php – this is where we will put our settings and make the calls to the correct methods and query Facebook
like.php – content displayed to likers
noLike.php – content displayed to non-likers
header.php – basic header that can contain any static elements
footer.php – Again a static area that is great for housing your javascript calls

To Deploy –

Download FBVersion and unzip
create a folder on your server for example www.example.com/facebook
place all of the files from FBVersion in this folder.
Create an application on Facebook and point the Canvas URL to your URL -
In index.php there are two places you will need to replace your APPID and APP_SECRET
Once you’ve done this you’re ready to rock and roll!

DOWNLOAD FROM GIT | CHECK OUT THE DEMO

comments