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.
GET /v21.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/v21.0/<PRODUCT_CATALOG_ID>/event_stats
Parameter | Description |
---|---|
breakdowns list<enum {DEVICE_TYPE}> | The way your results will be broken down. If you specify |
Reading from this edge will return a JSON formatted result:
{ "
data
": [], "paging
": {} }
data
paging
Error | Description |
---|---|
100 | Invalid parameter |
270 | This 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 |
200 | Permissions error |