When a Facebook post is boosted via the Facebook UI, a handy little "View results" button and little bar chart of boosted vs. organic reach is shown.
When boosting via the API, I can't get this to show up. Is this display exclusively for boosts via the Facebook interface, or can it be triggered via the API somehow?
The code we're using to create the ad is as follows:
$adset = new AdSet(null, <ad account ID>);
$adset->setData([
AdSetFields::NAME => 'Test Adset',
AdSetFields::CAMPAIGN_ID => <campaign ID>,
AdSetFields::DAILY_BUDGET => 100,
AdSetFields::IS_AUTOBID => true,
AdSetFields::LIFETIME_BUDGET => 100,
AdSetFields::TARGETING => <targeting specs>,
AdSetFields::OPTIMIZATION_GOAL => OptimizationGoals::POST_ENGAGEMENT,
AdSetFields::BILLING_EVENT => BillingEvents::IMPRESSIONS,
AdSetFields::START_TIME => <start time>,
AdSetFields::END_TIME => <end time>,
])->validate()->create([
AdSet::STATUS_PARAM_NAME => AdSet::STATUS_ACTIVE,
]);
$creative = new AdCreative(null, <ad account ID>);
$creative->setData([
AdCreativeFields::NAME => 'Test Creative',
AdCreativeFields::OBJECT_STORY_ID => '<Facebook post ID>',
])->create();
$ad = new Ad(null, <ad account ID>);
$ad->setData([
AdFields::CREATIVE => ['creative_id' => $creative->id],
AdFields::NAME => 'Test Ad',
AdFields::ADSET_ID => $adset->id,
])->create([
Ad::STATUS_PARAM_NAME => Ad::STATUS_ACTIVE,
]);