Returns the delivery estimate for a given ad set. You are not able to retrieve this field for inactive Lookalike Audiences.
Delivery estimate for a given ad set. All fields are optional and use the campaigns current settings as the default. You can override the fields to see the delivery estimates if you edit the ad set to the new configuration
This API is on a phased roll out so you may not have access straight away. All accounts should have access by July.
use FacebookAds\Api;
use FacebookAds\Http\RequestInterface;
use FacebookAds\Object\Fields\TargetingFields;
use FacebookAds\Object\Values\AdSetOptimizationGoalValues;
$targeting = array(
TargetingFields::GEO_LOCATIONS => array(
TargetingFields::COUNTRY_GROUPS => array('worldwide'),
),
TargetingFields::USER_DEVICE => array(
'Galaxy S6',
'One m9',
),
TargetingFields::USER_OS => array(
'android',
),
);
$estimate = Api::instance()->call(
'/' . <AD_SET_ID> . '/delivery_estimate',
RequestInterface::METHOD_GET,
array(
'targeting_spec' => $targeting,
'optimization_goal' => AdSetOptimizationGoalValues::IMPRESSIONS,
));
from facebookads import FacebookAdsApi
from facebookads.adobjects.adset import AdSet
from facebookads.adobjects.targeting import Targeting
from facebookads.adobjects.targetinggeolocation import TargetingGeoLocation
params = {
AdSet.Field.optimization_goal: AdSet.OptimizationGoal.impressions,
'targeting_spec': {
Targeting.Field.geo_locations: {
TargetingGeoLocation.Field.country_groups: ['worldwide'],
},
Targeting.Field.user_device: ['Galaxy S6', 'One m9'],
Targeting.Field.user_os: ['android'],
},
}
path = "/{}/delivery_estimate".format(<AD_SET_ID>)
estimate = FacebookAdsApi.get_default_api().call('GET', (path,), params=params)
curl -G \
--data-urlencode 'targeting_spec={
"geo_locations": {"country_groups":["worldwide"]},
"user_device": ["Galaxy S6","One m9"],
"user_os": ["android"]
}' \
-d 'optimization_goal=IMPRESSIONS' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/<AD_SET_ID>/delivery_estimate
Sample response:
{ "data": [ { "bid_estimate": { "min_bid": 25, "median_bid": 39, "max_bid": 62 }, "daily_outcomes_curve": [ { "spend": 0, "reach": 0, "impressions": 0, "actions": 0 }, { "spend": 265, "reach": 8243.6443831081, "impressions": 10350.320895139, "actions": 156.50895237165 }, { "spend": 526, "reach": 18251.053723186, "impressions": 22749.898172632, "actions": 240.93947618433 }, { "spend": 765, "reach": 28407.177135996, "impressions": 33619.733342562, "actions": 346.99329322783 }, { "spend": 1062, "reach": 45928.042945565, "impressions": 51637.737002525, "actions": 471.64889614235 }, { "spend": 1333, "reach": 58152.394099699, "impressions": 63862.08815666, "actions": 592.02344542053 }, { "spend": 1634, "reach": 68650.147937582, "impressions": 74359.841994542, "actions": 725.48065259603 }, { "spend": 2167, "reach": 85128.56776818, "impressions": 90838.26182514, "actions": 961.78927791879 }, { "spend": 2683, "reach": 100125.02260147, "impressions": 105834.71665843, "actions": 1190.1904175239 }, { "spend": 3080, "reach": 110785.65163889, "impressions": 116495.34569585, "actions": 1366.401954784 }, { "spend": 3671, "reach": 124468.70907527, "impressions": 130178.40313223, "actions": 1628.1358564645 }, { "spend": 4298, "reach": 138795.17915887, "impressions": 144504.87321583, "actions": 1906.3733131575 }, { "spend": 5273, "reach": 162271.93037401, "impressions": 167981.62443097, "actions": 2338.2609920184 }, { "spend": 6762, "reach": 188418.07621686, "impressions": 194127.77027382, "actions": 2998.220590189 }, { "spend": 8994, "reach": 224376.16174341, "impressions": 230085.85580037, "actions": 3987.6143359673 }, { "spend": 12188, "reach": 266827.68508417, "impressions": 272537.37914113, "actions": 5403.4338668144 }, { "spend": 16703, "reach": 330970.96477895, "impressions": 336680.65883591, "actions": 7405.031600765 }, { "spend": 23259, "reach": 410254.01233734, "impressions": 415963.7063943, "actions": 10311.291929578 }, { "spend": 33049, "reach": 523482.54737222, "impressions": 529192.24142918, "actions": 14651.104145786 }, { "spend": 46989, "reach": 657402.38372782, "impressions": 664416.06303304, "actions": 19956.627010856 }, { "spend": 67975, "reach": 795688.26577887, "impressions": 822953.27877593, "actions": 26906.517746307 }, { "spend": 100421, "reach": 894612.83601046, "impressions": 944277.29484448, "actions": 31053.861174147 }, { "spend": 147546, "reach": 1077049.9179166, "impressions": 1213595.3932081, "actions": 35353.649635036 }, { "spend": 312396, "reach": 1349081.6795344, "impressions": 1530801.9938585, "actions": 39179.232293771 }, { "spend": 460465, "reach": 1835921.1505569, "impressions": 2095928.7391463, "actions": 41643.754557784 }, { "spend": 680613, "reach": 2003678.7604205, "impressions": 2305825.3800893, "actions": 47090.041460093 }, { "spend": 1024689, "reach": 2443506.7846146, "impressions": 2968258.3978486, "actions": 50088.868950848 }, { "spend": 1537530, "reach": 2530105.4724989, "impressions": 3115204.5536406, "actions": 54518.590207387 }, { "spend": 2297771, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 60544.831018138 }, { "spend": 3402952, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 63966.065325909 }, { "spend": 5022226, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 65945.733078085 }, { "spend": 7395692, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 10818977, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 15711911, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 22739269, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 32817289, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 47384009, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 68505290, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 99073087, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 143332473, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 206718243, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 298340807, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 430070961, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 611126866, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 860296915, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 }, { "spend": 879861176, "reach": 2624395.7032647, "impressions": 3275202.2080889, "actions": 66403.892446382 } ], "estimate_dau": 568166399, "estimate_mau": 1096000000, "estimate_ready": true } ] }
The daily_outcomes_curve
field will only have data when we are able to provide high confidence predictions. When we do not have high confidence predictions we will return an array of 1 point with all 0s.
GET /v21.0/{ad-set-id}/delivery_estimate 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(
'/{ad-set-id}/delivery_estimate',
'{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(
"/{ad-set-id}/delivery_estimate",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{ad-set-id}/delivery_estimate",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{ad-set-id}/delivery_estimate"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Thông số | Mô tả |
---|---|
optimization_goal enum{NONE, APP_INSTALLS, AD_RECALL_LIFT, ENGAGED_USERS, EVENT_RESPONSES, IMPRESSIONS, LEAD_GENERATION, QUALITY_LEAD, LINK_CLICKS, OFFSITE_CONVERSIONS, PAGE_LIKES, POST_ENGAGEMENT, QUALITY_CALL, REACH, LANDING_PAGE_VIEWS, VISIT_INSTAGRAM_PROFILE, VALUE, THRUPLAY, DERIVED_EVENTS, APP_INSTALLS_AND_OFFSITE_CONVERSIONS, CONVERSATIONS, IN_APP_VALUE, MESSAGING_PURCHASE_CONVERSION, SUBSCRIBERS, REMINDERS_SET, MEANINGFUL_CALL_ATTEMPT, PROFILE_VISIT, MESSAGING_APPOINTMENT_CONVERSION} | The optimization goal that you want the estimate for. You will only get action predictions for certain optimization goals where actions make sense. For allowed values please see optimization_goals |
promoted_object Object | The promoted object for the ad set that you want an estimate for. This is the same format as when you create an ad set |
targeting_spec Targeting object | The targeting specification for delivery estimate. See targeting |
Đọc từ cạnh này sẽ trả về một kết quả JSON đã định dạng:
{ "
data
": [], "paging
": {} }
data
paging
Lỗi | Mô tả |
---|---|
100 | Invalid parameter |
2635 | You are calling a deprecated version of the Ads API. Please update to the latest version. |
190 | Invalid OAuth 2.0 Access Token |
2641 | Your ad includes or excludes locations that are currently restricted |
200 | Permissions error |
80004 | There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting#ads-management. |
613 | Calls to this api have exceeded the rate limit. |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
2654 | Failed to create custom audience |
105 | The number of parameters exceeded the maximum for this operation |