Versione API Graph

Product Catalog Event Stats

Lettura

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.

Esempio

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
Se desideri scoprire come usare l'API Graph, leggi la nostra Guida per l'utilizzo dell'API Graph.

Parametri

ParametroDescrizione
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.

Campi

La lettura da questo segmento fornirà un risultato formattato JSON:

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

data

Una lista di nodi ProductEventStat.

paging

Per ulteriori dettagli sulla paginazione, consulta la Guida su API Graph.

Error Codes

ErroreDescrizione
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.

Creazione

Non puoi eseguire questa operazione in questo endpoint.

Aggiornamento

Non puoi eseguire questa operazione in questo endpoint.

Eliminazione

Non puoi eseguire questa operazione in questo endpoint.