Personalize your site and extend viral reach with Facebook Connect

posted by Development

Be honest.

You and just about everyone out there with an Internet connection is addicted to Facebook. Whether you admit or not, chances are, you have uploaded some great photos, hometown information and even your educational feats to this fancy, far-reaching vehicle we call Facebook.

You find yourself visiting Facebook on a daily basis. You find comfort in Facebook. Others do as well.

Lucky for you and your online goals, Facebook provides a pretty liberal set of APIs and connection methods for you to take advantage. In this post, we are going to address advanced topics that can serve as a brief icebreaker into features available to you and your site’s users.

You can pull an amazing amount of information from Facebook directly into your website, mobile app or mobile website using these APIs. As a result, you can personalize your applications to a degree that engages your users and drives growth.

If you are looking to extend Facebook’s personalized touch and social engagement to your site, first look to their developer website and documentation therein. They list and document the various methods developers can use to add Facebook elements to their websites.

The most dynamic method is Facebook Connect, which we will discuss later.

The simplest method is social plugins. You have probably seen the “Like,” “Share” or even the “Live Stream” of activity on websites you have stumbled across (you can find an example at the bottom of this post). Those social plugins can be implemented via iframes or Facebook’s custom programming language.

Facebook’s programming language of FBML and XFBML, coupled with their Javascript SDK, directly adds elements to your site with more flexibility than the iframe alternative.

For instance, say you wanted to add the “Like” button to your page:
Using the iframe method, the code would be:

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>

Using the XFBML method, the code would be:

<fb:like layout="button_count"></fb:like>

The XFBML is easily the most condensed and efficient method, but remember that you have to use the Javascript SDK in order to parse and activate those elements correctly. It also requires a more seasoned developer to pull it off should there be issues.

Now, back to Facebook Connect. If the social plugins were windows of the Facebook house, Facebook Connect is the open door.

To initiate the connection, you first have to authenticate the user. This must happen before any functionality or information can really be processed or communicated back and forth between Facebook. So, the information you can pull from Facebook is going to be on an Application or User basis.

Each Facebook Connect instance needs an Application ID and Key. Using that and the current users’ logged-in session, you can then have free reign within the API to pull and push information to and from your site. Quick note: Some information and entities can only be modified or accessed after users grant extended privileges to your application.

For example, I have a website with articles about different areas in Ohio. I want my users to be able to share news stories with others, based on their Facebook friends’ locations. Using the API available, you can easily do this.

The API provides a great array of methods and calls to pull your friends, photos, albums, events and news feeds. You can also use the Facebook Query Language (FQL) to query the Facebook entities available. If you are familiar with T-SQL language, FQL will be no problem.

Example: To get all of my users’ friends’ birthdays, names and small picture URLs that have entered a birthday value, my FQL query would look like this.
"Select birthday_date,name,pic_small from user where uid in(select uid2 from friend where uid1='" & Me.userid.ToString & "') and birthday_date<>'' LIMIT 200 "

This post covered some very technical topics and of course, the devil is in the details. We hope you find this as a springboard into more available resources from Facebook. Please don’t be afraid to ask specific questions on this.

How could you see yourself using Facebook Connect to drive growth within your website?

POSTED IN: Web


Related Posts

Learn the latest marketing trends as you plan for 2012More: Creative Department Manager Dave Berman recaps 2011Looking Ahead at SEO in 2012How does a Web page work? The role browsers play in the way your page looks and functions
Learn the latest marketing trends as you plan for 2012More: Creative Department Manager Dave Berman recaps 2011Looking Ahead at SEO in 2012How does a Web page work? The role browsers play in the way your page looks and functions

1 Comment(s)


lee moran said: 

Thanks for this info. Do you know of any free programs to make Facebook pages?
September 14, 2011 aA 11:49 AM

Name
Email
Comment
Contact us! call 888.321.8422 or fill out the following fields::