API Graph versión

Product Catalog Event Stats

Lectura

Stats on pixel fires and app events from sources associated with this catalog.

Each result object contains the count of matched and unmatched content ids and the count of matched and unmatched unique content ids for each day over the previous 28 days. All results are automatically broken down by DA events (ViewContent, AddToCart and Purchase) and source of the event (pixel or app). Additional breakdowns like device_type can be requested for more granularity. Statistics about only those external event sources which the user making the request has access to, would be returned.

Ejemplo

Graph API Explorer
GET /v19.0/<PRODUCT_CATALOG_ID>/event_stats HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/<PRODUCT_CATALOG_ID>/event_stats',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/<PRODUCT_CATALOG_ID>/event_stats",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/<PRODUCT_CATALOG_ID>/event_stats",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/<PRODUCT_CATALOG_ID>/event_stats"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
curl -X GET -G \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v19.0/<PRODUCT_CATALOG_ID>/event_stats
Si quieres obtener información sobre cómo usar la API Graph, lee nuestra guía de uso de la API Graph.

Parámetros

ParámetroDescripción
breakdowns
list<enum {DEVICE_TYPE}>

The way your results will be broken down. If you specify ["device_type"] your results will be grouped by device_type, as well as by source and event. Results are always broken down by DA events (ViewContent, AddToCart and Purchase) and source of event (pixel or app) by default.

Campos

La lectura de este perímetro mostrará un resultado con formato JSON:

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

data

Una lista de nodos ProductEventStat.

paging

Para obtener más detalles sobre la paginación, consulta la guía de la API Graph.

Error Codes

ErrorDescripción
100Invalid parameter
270This Ads API request is not allowed for apps with development access level (Development access is by default for all apps, please request for upgrade). Make sure that the access token belongs to a user that is both admin of the app and admin of the ad account
200Permissions error
2635You are calling a deprecated version of the Ads API. Please update to the latest version.

Creación

No puedes realizar esta operación en este extremo.

Actualizando

No puedes realizar esta operación en este extremo.

Eliminando

No puedes realizar esta operación en este extremo.