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.
You should have created
config.php as mentioned in the beginning of this chapter. Also, you should have provided
read_insights extended permission to the application.
The following steps will demonstrate how to retrieve impressions of the Like Box plugin:
index.phpand 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>