• Home
  • Articles
    • IT
      • Web Multimedia
      • Oracle
    • Social Media
    • Options
    • Miscellaneous
  • About
  • Contact
Articles Social Media Integration How to CORRECTLY add the Facebook Social plugins to your website

How to CORRECTLY add the Facebook Social plugins to your website

Sunday, 03 October 2010 17:37

There's a lot of misinformation out there about how to add the Facebook Social plugins to your website. In this article I'll go over how to CORRECTLY add the Facebook Social Plugins to your website and be able to use ALL the plugin functionality. 

how_to_correctly_add_fb_plugins_teaser

3 Steps 

There are 3 steps to CORRECTLY adding the Facebook Social Plugins to your website, there are:
  1. Getting an Application ID – This is needed so you can use 100% of the Social Plugin functionality.
  2. Adding the Facebook SDK to the header of your website - or at least the header of the pages you want to add the Social Plugins too.
  3. Adding the code for each Social Plugin you wish to use.

The most common mistake I've seen is people not getting their own Application ID. The Like button Social Plugin for example is easily added to your website, however if you don't have your own Application ID, the number of "likes" isn't kept after you leave your website and come back. The same applies with the Comments Social Plugin, and some of the other Social Plugins flat out will not work without your own Application ID.

Step #1 - Get an Application ID

Before you can use 100% of all of the Facebook Social Plugin functionality, and almost the entire functionality of the Comments Facebook Social Plugin, you must first get yourself a Facebook Application ID. This is a very simple process, just follow the instructions below:
  1. Go to: http://developers.facebook.com/setup/, enter your facebook account info if prompted.
  2. Enter the name of the website, for example "Gareth Hooper's Blog", as well as the Site URL (garethhooper.com/ for example, and don't forget the / on the end), and select the correct locale. Then click Create Application.
  3. Enter the security check, and click Submit.
  4. Make a note of the App ID and APP Secret. You will definitely need the App ID for Step 2. Please bear in mind that it may take as long as 20 minutes for the App ID to propagate out, so if you literally try to use it immediately after getting the ID, it may not work correctly.

Step #2 – Add the Facebook SDK

You need to add the Facebook SDK (think of it of more as a library that the Social Plugins need to access) to your website as a whole, or at least to the pages where you intend have Social Plugins.

To do this, you will need to add the following code to the header of at least every page you intend to have a Social Plugin. If you are using Wordpress or Joomla like I am, you should just try to the SDK code as close to the top of the page as possible. It just needs to load in the visitor’s web browser before the Social Plugin code does.

DON’T FORGET TO REPLACE THE APP ID IN THE CODE WITH THE APP ID YOU GOT IN STEP #1 ABOVE.

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({appId: 'your app id', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
</script> 

Step #3 – Adding the Social Plugins

Now that the Facebook SDK (with your own Application ID) has been added, the rest is easy, just add the Social Plugin code. People who use Wordpress and Joomla, you do need to be conscious of the fact that the Facebook SDK needs to load BEFORE the Social Plugin, so if you experience any problems, move the Social Plugin to the bottom of the page (so it is one of the last things to load) and see if you fixes the problem. It may not be a permanent fix, but at least you would have identified the problem. The permanent fix of course would be to move the Facebook SDK closer to the top of the page.

Getting the Code for each Social Plugin

Social Plugin #1 - Like Button

My detailed description of what the Like Button does.

To get the code for the Like Button, go to the Facebook Developers page for the Like Button, customize it as you like, and then click the Get Code button to get the code to add to your website.

Social Plugin #2 - Like Box

My detailed description of what the Like Box does.

To get the code for the Like Box, go to the Facebook Developers page for the Like Box, customize it as you like, and then click the Get Code button to get the code to add to your website.

Social Plugin #3 - Comments

My detailed description of what the Comments plugin does.

To get the code for the Comments plugin, go to the Facebook Developers page for the Comments plugin, customize it as you like, and then click the Get Code button to get the code to add to your website.

Social Plugin #4 - Recommendations

My detailed description of what the Recommendations plugin does.

To get the code for the Recommendations plugin, go to the Facebook Developers page for the Recommendations plugin, customize it as you like, and then click the Get Code button to get the code to add to your website.

Social Plugin #5 - Activity Feed

My detailed description of what the Activity Feed plugin does.

To get the code for the Activity Feed plugin, go to the Facebook Developers page for the Activity Feed plugin, customize it as you like, and then click the Get Code button to get the code to add to your website.

Social Plugin #6 - Live Stream

My detailed description of what the Live Stream plugin does.

To get the code for the Live Stream plugin, go to the Facebook Developers page for the Live Stream plugin, customize it as you like, and then click the Get Code button to get the code to add to your website.

Social Plugin #7 - Login with Faces

My detailed description of what the Login with Faces plugin does.

To get the code for the Login with Faces plugin, go to the Facebook Developers page for the Login with Faces plugin, customize it as you like, and then click the Get Code button to get the code to add to your website.

Social Plugin #8 - Facepile

My detailed description of what the Facepile plugin does.

To get the code for the Facepile plugin, go to the Facebook Developers page for the Facepile plugin, customize it as you like, and then click the Get Code button to get the code to add to your website.


Related Articles

  • How to create your own Facebook Custom Page with your own page icon
  • Share on Facebook – How to embed your own Videos on someone's Facebook wall when your web pages are “Shared” on Facebook
  • Share on Facebook - Customizing the Text and Images that are posted when your web pages are “Shared” on Facebook
  • Overview of the New Facebook Social Plugins – Part 1 of 3

 

Please leave me a comment if you found this article useful or if you have any questions.

Share This
Email This

Comments (22)

Subscribe to this comment's feed
...
0
Exelent Artikel thanks a lot one of the view Blogs i subscribe on Facebook too
@metacowboy , November 07, 2010 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
Hi, Im new to this whole HTML thing, and I clearly dont understand it, I think I did all of your steps correctly, but on my web page editor the things that i added are just showing up as place holders? can you give me any insite to this? Thank you!
Meagan W. , April 13, 2011 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
Some people were having trouble with logged out Facebook users not being able to see the content of embedded facebook social plugins.

You can correct this by updating the age restrictions on the Facebook fanpage in question by clicking "edit page" and going to "manage permissions." Change the age to "Anyone 13+" and all should be well if you're having issues...

I wrote a brief blog post about it and made a little screenshot with a walkthrough here: http://www.profromgo.com/faceb...gged-users
Chris , December 15, 2011 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
Em menos de 1 minuto você estará assistindo TV de graça www.tvdigitalnopc.com.br
ric , December 21, 2011
  • report abuse
  • +1
  • vote down
  • vote up
...
0
Hi, this is a good post, indeed a great job…. You must have done good research for the work. I wanted to thank you for this great article. I am very much pleased with the contents you have mentioned. I am looking forward for more posts on topic.
Dermal fillers Adelaide , January 12, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
Thanks for taking the precious time to discuss this topic with us, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, can you updating your blog with more information? It is extremely helpful for me.
Breast enhancement Gold Coast , February 01, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
Good site! I really love how it is easy on my eyes and the data are well written. I am wondering how I could be notified when a new post has been made. I have subscribed to your RSS feed which must do the trick! Have a nice day!
Zeltiq NYC , March 14, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
One of the more impressive blogs Ive seen. Thanks so much for keeping the internet classy for a change. Youve got stye, class, bravado. I mean it. Please keep it up because without the internet is definitely lacking in intelligence
buy eberjey lingerie , March 15, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
This is really interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your wonderful post. Also, I’ve shared your web site in my social networks!
tourism marketing speaker , March 15, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
Great blog, just looking around some blogs, seems a pretty nice platform you are using. Thanks for posting this and sharing this information.you have got a really useful blog
buy eberjey sleepwear , March 19, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
Thanks for providing such a great article, it was excellent and very informative. It’s my first time that I visit here. I found a lot of informative stuff in your article. Keep it up. Thank you.
breast reconstruction surgery after mastectomy nyc , March 20, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
so pretty.You are a good teacher. Lucky student!,http://www.pandorajewelrybeadscharms.com
Pandora Jewelry sale , March 28, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
This was my first time I visited here. I found so many interesting stuff in your blog. It's actually a great and helpful piece of information. I'm glad that you just shared this useful information with us.
Play Frenches Forest , April 05, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
Great blog, just looking around some blogs, seems a pretty nice platform you are using. Thanks for posting this and sharing this information.you have got a really useful blog
childrens play centre , April 05, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
Congratulations for posting such a useful blog. Your blog isn’t only informative but also extremely artistic too. There usually are extremely couple of individuals who can write not so easy articles that creatively. Keep up the good writing !!
Events courses , April 09, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
This is such a wonderful learning resource that you'll be supplying and you provide it away for free. I like sites that help in gaining information. Thank you for this knowledgeable site.
Marketing courses , April 09, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
This is such a wonderful learning resource that you'll be supplying and you provide it away for free. I like sites that help in gaining information. Thank you for this knowledgeable site.
online rsa , April 11, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
This is so cool. I am such a huge fan of their work. I really am impressed with how much you have worked to make this website so enjoyable.
Event portable signage , April 11, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
excellent post. I was checking continuously this blog and I am impressed! Extremely useful information specially the last part I care for such info much. I was seeking this particular information for a very long time. Thank you and good luck.
responsible service of alcohol australia , April 12, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
This is really interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your wonderful post. Also, I’ve shared your web site in my social networks!
responsible service of alcohol qld , April 12, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided veryhelpful.
Botox Auckland , April 13, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up
...
0
This is the perfect blog for anyone who wants to know about this topic. The article is nice and it is pleasant to read. I have known very important things over here. Absolutely with you it agrees. In it something is also to me your idea is pleasant.
Dermal Filler Auckland , April 13, 2012 | url
  • report abuse
  • +0
  • vote down
  • vote up

Write comment

feedShow/Hide comment form
bold italicize underline strike url image quote smile wink laugh grin angry sad shocked cool tongue kiss cry
smaller | bigger

busy
< Prev   Next >

Like us on Facebook

Recommended Articles

  • Site Map
  • Legal
  • Privacy Policy
2011 GarethHooper.com