Stats for a given ad campaign
GET v25.0/...?fields={fieldname_of_type_AdCampaignStats} 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(
'...?fields={fieldname_of_type_AdCampaignStats}',
'{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(
"...?fields={fieldname_of_type_AdCampaignStats}",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"...?fields={fieldname_of_type_AdCampaignStats}",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"...?fields={fieldname_of_type_AdCampaignStats}"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];| Field | Description |
|---|---|
idtoken with structure: ID | The id of the stats reports. |
account_idstring | The ID number of your ad account, which groups your advertising activity. Your ad account includes your campaigns, ads and billing. |
actions(list) or (map) | Number of actions for each action type. Each number is the sum of actions that resulted from either clicking or being served an ad. |
adgroup_idid | The unique ID of the ad you're viewing in reporting. |
campaign_idid | The unique ID of the ad set you're viewing in reporting. An ad set is a group of ads that share the same budget, schedule, delivery optimization and targeting. |
campaign_idslist<id> | Set of ad campaign ids |
clicksunsigned int32 | The number of clicks on your ads. |
end_time(timestamp) or (string) | End time |
impressionsimpressions | The number of times your ads were on screen. |
inline_actionsmap | The number of times people liked your Page, RSVPed to your event, or installed your app through the ad creative. |
io_numberunsigned int32 | IO Number |
is_completedbool | Is the ad compaign completed ? |
line_numberunsigned int32 | Line number |
newsfeed_position | Information about ads displayed on newsfeed |
social_clicksunsigned int32 | The number of clicks (all) when your ad was displayed with social information, which shows other Facebook friends who engaged with your Facebook Page or ad. |
social_impressionsimpressions | The number of times your ads were viewed when displayed with social information, which shows Facebook friends who engaged with your Facebook Page or ad. |
social_spentunsigned int32 | The total amount you have spent so far for social clicks and impressions |
social_unique_clicksunsigned int32 | The number of people who performed a click (all) on your ad when it was displayed with social information, which shows other Facebook friends who engaged with your Facebook Page or ad. |
social_unique_impressionsimpressions | The number of people who saw your ad when displayed with social information, which shows other Facebook friends who engaged with your Facebook Page or ad. |
spentnumber | The estimated total amount of money you've spent on your campaign, ad set or ad during its schedule. |
start_time(timestamp) or (string) | Start time |
topline_idid | Topline ID |
unique_clicksunsigned int32 | The number of people who performed a click (all). |
unique_impressionsimpressions | The number of people who saw your ads at least once. Reach is different from impressions, which may include multiple views of your ads by the same people. |