O'Reilly logo

Facebook Application Development with Graph API Cookbook by Apeksha Singh, Shashwat Srivastava

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving impressions of the Like Box plugin

Facebook allows us to retrieve information about our various Social Plugins programmatically. We can retrieve the impressions of our Like Box by using the Facebook Graph API. Here, we will see how to do so.

Getting ready

You should have created index.php and config.php as mentioned in the beginning of this chapter. Also, you should have provided read_insights extended permission to the application.

How to do it...

The following steps will demonstrate how to retrieve impressions of the Like Box plugin:

  1. Open index.php and append the following code to create an output table:
    <table border='1'>
      <tr>
        <th>metric</th>
        <th>end_time</th>
        <th>period</th>
        <th>value</th>
      </tr>
  2. Next, add your application ID here:
     <?php ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required