The Open Graph protocol enable developers to integrate their web pages in social graph. It is created by Facebook and let you add structured information about your pages to represent it as an entity in the Web. Also it acts as a source for modern search engines to dig more information about your web pages too. If you are mind in adding Facebook social plugins, then these meta tags supports your plugins in fetching information to use in snippets. So would you like to personalize your pages and customize your Facebook social plugins?
In addition to customizing information used by Facebook social plugins, it allows you to administer Facebook plugins implemented on your blog. For example, comment moderation will be allowed for only Admins of your blog. If you list yourself as an Admin using admins open graph meta tag, whenever you signed into your Facebook account the comment box allows you to moderate comments in your pages. Note: If you have a restricted blog, the Open Graph tags might not be crawlable. So you will find no changes in snippets, no comment moderation available or missing information when sharing, though you have specified information using Open Graph meta tags.
Steps:
1. Go to Blogger Dashboard.
2. Click on Design link.
3. Navigate to Edit HTML tab.
Note: Before editing your template, you may want to save a copy of it.
4. Search for </head> in your template and add following Open Graph meta tags before that, after filling your required information.
<b:if cond='data:blog.pageType == "index"'>
<meta content='blog' property='og:type'/>
<b:else/>
<meta content='article' property='og:type'/>
</b:if>
<meta content='Your Facebook User ID' property='fb:admins'/> <meta content='Your Blog Name' property='og:site_name'/> <meta content='Your Application ID' property='fb:app_id'/>
<meta content='Page/Post Title' property='og:title'/>
<meta content='Page Description' property='og:description'/> <meta content='URL of Page/Post' property='og:url'/> <meta content='Image URL' property='og:image'/>
Color Indication Information
- Your Page Type
The type of your page. As you managing a blog, you can specify blog here as below.
<meta content='blog' property='og:type'/>
But it should be used to represent an entire site and only apply for theroot/home page. As you publish posts and your blog contain transient content on post pages, you need to specify article on those pages.
<meta content='article' property='og:type'/>
Its time consuming to specify those tags for each pages and you can't use both on your template because they will apply for all pages including homepage and post pages. So here I have used conditional statements to specify root page as blog and other pages as articles. Now you don't need to change these as you managing a blog and add the code directly.
Add your Facebook User ID here. You can find your Facebook User ID by appending your Facebook username to below URL. You can find your username from http://www.facebook.com/username/.
http://graph.facebook.com/[Your Facebook Username]
i.e: http://graph.facebook.com/Mayura
If you don't have a Facebook username, go to your Facebook profile page and click on your profile picture. Then track your URL in address bar. Your User ID can find at the end of URL.
i.e: http://www.facebook.com/media/set/?set=pa.100200300
Your created Application ID Page/Post title you are comment on. This is vary on each page and Facebook will extract page title using page metadata. But if you need to specify one title for all posts when users comment and share, specify a title here and add tag. Else do not use this tag and plugin will detect page title automatically.
- Page Description
This is your page/post description. Mostly descriptions may vary on each page due to variance of content on each page. Generally Facebook extracts description from your page metadata if you have specified it already. But if you wish to specify identical description for all pages, then you can specify it here and Facebook will add up description whenever user post comment on their profile. Else do not use this tag.
However you may use Facebook like or send button on your homepage to represent your site. If you do not make use of description meta tag on your blog, then you can specify a description only for your homepage to describe your blog and to append when users like or share your blog through Facebook social plugins. If so, use below code instead.
<b:if cond='data:blog.pageType == "index"'>
<meta content='Blog Description' property='og:description'/>
</b:if>
URL of Page/Post you are comment on. If you need to share specific URL other than the post URL, specify it and add the tag. Else don't use this tag and the comment plugin will detect your current URL. Specify an URL of an image here. So when users post comment to their Facebook profile, this image will be added with the post. If you didn't specify this tag, plugin will extract image from current post.
However most likely if you are using Facebook like or send button on homepage to represent your site, you can specify a logo and when readers likes your site the logo will appended to snippet being published on their wall. If so, use below code snippet instead.
<b:if cond='data:blog.pageType == "index"'>
<meta content='Image URL' property='og:image'/>
</b:if>
Note: After adding Open Graph meta tags for your blog, you can use Facebook Debugger to see how Facebook treat your page when plugins crawl your page. |
|