Social Media
Integration
How to CORRECTLY add the Facebook Social plugins to your website
|
|
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.
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.
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> |
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.
Please leave me a comment if you found this article useful or if you have any questions.
| < Prev | Next > |
|---|