Graph API Version

User Adnetworkanalytics

Reading

Insights for all of this user's Audience Network apps.

Graph API Explorer
GET /v2.9/{user-id}/adnetworkanalytics HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{user-id}/adnetworkanalytics'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{user-id}/adnetworkanalytics",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{user-id}/adnetworkanalytics",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{user-id}/adnetworkanalytics"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
No data
Page management Apps
No data
Other Apps
  • read_insights

Parameters

NameDescription
aggregateBy
enum {COUNT, USERS, TOPK, SUM, USD_SUM, UNKNOWN_USERS, SCORE, MEDIAN_VALUE, MEDIAN_VALUE_PER_USER, DAU, WAU, MAU, PERCENTILES_COUNT, PERCENTILES_VALUE, PERCENTILES_USD_VALUE}

Used to specify aggregate type, either SUM or COUNT

app_ids
list<int64>
Default value: Array

Required list of app ids to retrieve data for. Requestor must have insights access for each app

breakdowns
list<string>
Default value: Array

Data breakdowns -- valid breakdowns are app, placement, and country

event_name
string

Specifies which metric to return, used in conjunction with aggregateBy value. One of fb_ad_network_request, fb_ad_network_imp, fb_ad_network_click, or fb_ad_network_revenue

period
enum{mins_15, hourly, daily, weekly, monthly, lifetime, days_28, range}
Default value: daily

Length of time over which insights are bucketed, either daily or range

since
datetime

A unix timestamp or strtotime data value that indicates the start of the data range

until
datetime

A unix timestamp or strtotime data value that indicates the end of the data range

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of InsightsQueryResult nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
3001Invalid query

Creating

You can't perform this operation on this endpoint.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.