Monday, September 22, 2014

Complete Tutorial on Facebook Open Graph

Facebook Open Graph for Web Developer

Facebook Open Graph allows you to use custom site title, URL, description and even a custom image when you share your page. If you use Facebook Open Graph code on your site, every time when you share any page, it will be counted directly for your home page. Suppose, if I share the following URL on Facebook -

The sharing/ like will be counted for -

But If there is no open graph code on my site, the sharing of the first URL will be counted individually. And the sharing will not be counted for your home page. Now I guess, you've understood the importance of open graph. It's really helpful to increase facebook likes of your site rapidly. 

Couple of days ago, I discussed about how to claim a site on Facebook. Following the same method, you can place Facebook Open Graph code on your site. Open graph code is as follows:

<meta property="og:title" content="Site Title"> 
<meta property="og:description" content="Site Description"> 
<meta property="og:type" content="Content Type">
<meta property="og:url" content=""> 
<meta property="og:image" content="Custom Image Link"> 
<meta property="og:site_name" content="Your Site Name"> 
<meta property="fb:admins" content="Your Numeric FB ID">

You have to place the above code in the head (<head> </head>) section of your site's HTML. The code must be placed before closing head tag - </head>.

Facebook Insights Meta Code

Now follow the steps below:

  1. Go to Facebook Insights > Domain Insights > Add your Domain
  2. Type your home page URL > Copy the Numeric FB ID > Keep the window open
  3. Go to your site's code or HTML and find the closing header tag </head>
  4. Place the above code before closing header tag
  5. Now back to the Facebook Insight Page 
  6. Hit on the Get Insights button
  7. Now you should be able to see your domain under the Domain Insights section

There are 7 meta properties in the above code. You have to change in the content option.  Make sure you've used them properly. I'm gonna clarify the points - 
  1. Site Title Example - Marks PC Solution.
  2. Site Description - What's your site about. Example - Your Ultimate Choice for Computer, Internet, Blogging, SEO & PC Troubleshooting Tips!
  3. Content Type - Website/ Blog/ Article/ News etc.
  4. Site URL Example -
  5. Custom Image - Upload your desired image in a server. Then simply copy and paste the link here. You can use to upload image.  
  6. Type your Site Title here. Example - Marks PC Solution.
  7. Numeric FB ID that you've got from the 2nd step in Facebook Insights Page. You can also find numeric by this method

Marks PC Solution Custom Image


If you face any problem after implementing the code on your site, you can take help of Debugger. Here you can paste your site URL and debug the errors. You can check whether all properties are functioning normally or if there is a problem. 

Remember, you can omit some properties. If you use Custom Image, then it will be same for any link of your site. So you can also use a shorter version of the code as below:

<meta content='Website' property='og:type'/> 

<meta content='' property='og:url'/> 
<meta content='100002127563096' property='fb:admins'/>

It will do the same job for you. You can also use multiple Admin IDs. Simply add more numeric IDs in the admin property.

If you need any support regarding Facebook Open Graph, please leave a comment . . . 

Stay with Marks PC Solution to get more interesting IT topics!

No comments:

Post a Comment