Metrics Table

Problem

What’s the schema for the metrics table?

Solution

The metrics table holds all of the metrics recorded for your application. Its fields are listed in Table 8-4. You can view the same metrics from inside the Facebook Insights app (http://www.facebook.com/business/insights/app.php?id=12345). Metrics are calculated at midnight Pacific time everyday, so you should convert your date values into epoch seconds based on midnight PST (see Formatting Relative Time for more about epoch seconds). More information about this table, including an up-to-date listing of fields, can be found at http://wiki.developers.facebook.com/index.php/Metrics_(FQL).

Table 8-4. metrics table fields

Name

Type

Index

Description

end_time

int

The ending date for which these metrics were recorded, in epoch seconds. See Formatting Relative Time for an explanation of epoch seconds.

period

int

Length of time for which you want results, in seconds. Supported lengths are one day (86400 seconds), seven days (604800 seconds), and 30 days (2592000 seconds).

active_users

int

 

Number of active users in your app on this day.

unique_adds

int

 

Number of unique new users for your app on this day (if the same user added, removed, and then added it again, it only counts for one).

unique_removes

int

 

Number of unique removes for your app on this day (if the same user added, removed, added, and removed, it only counts for one).

unique_blocks

int

 

Number of unique blocks for your app on this day (if the same user blocked, ...

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.