If you’re a website owner that gets most of your revenue from consumer traffic you should use Facebook Social Plugins. This post will give you a quick guide on how to do so.
Step 1: Paste the following Javascript anywhere after the <body> tag.
<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 2: Paste the following to every Page on your website where you want a Facebook Like Button. [1]
<fb:like></fb:like>
You’re Done! Simple right?
Step 3 (optional): You have the option of specifying open graph meta tags. Put them in the head of your website.
<meta property=”og:description” content=”Moko Marketing is a Facebook marketing blog. “/>
<meta property=”og:image” content=”http://www.mokomarketing.com/images/Logo.jpg“/> Must be JPG!
<meta property=”og:title” content=”Moko Marketing: Adding Social Plugins to your Site“/>
<meta property=”og:site_name” content=”Moko Marketing“/>
<meta property=”fb:admins” content=”xxxxxxxx“/> Admin account to publish updates from.
<meta property=”og:type” content=”website“/>
Adding an administrator account and meta tags let’s you publish status updates to individuals that click your Like buttons. Make sure your title tag doesn’t contain any blocked words such as ‘Facebook’, ‘Free’ or swears. Additionally after 10 likes you cannot changes these Open Graph meta tags. Facebook will also cache a lot of content making testing difficult on single buttons.
Comments Widget
Step 1: Same as before.
Step 2: Paste the following to every Page on your website where you want a Facebook Comments Widget. [2]
<fb:comments></fb:comments>
Step 3 (optional): Same as before.