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

Getting statistics about visitors using FQL multiquery

We can retrieve statistical information corresponding to the visitors who use our application such as their cities, countries, age, gender, and so on. Here, we will do so by using the FQL multiquery method.

Getting ready

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

How to do it...

The following steps will demonstrate how to acquire visitor statistics:

  1. Open index.php and append the following code to it:
    <?php
      $app_id = "your_app_id";
  2. Declare the array for executing multiple queries:
      $multi_queries = array();
  3. Select the user related metric from the ...

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