In this tutorial I will show you a very simple way to take facebook comments/likes statistic for all of URLs in your magento site.

To make your magento site faster, you can do this feature separately with magento system since it doesn’t use any core function. But if you want to save data into database of magento, you can connect it as module of magento.

facebook+magento+statistic

In another way to approach, you can do it so it will parse xml sitemap and then take all statistic and save to database. This way will make your code can work with any website. Is it nice?

Here is the core function to get all of likes/comments of a custom URL

Now let’s try to call this function

You will see the return of this json data

And you can test this data by call API manually https://graph.facebook.com/http://stackoverflow.com/

Is it simple? It ‘s time to call many URLs to have a full statistic feature for your magento site.

Good luck and welcome any comment.