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,
]);
Apparently this is by design:
This is actually by design. Boosting a post vi the UI and promoting it via the Ads API are treated as distinct actions. It is in fact possible to do both simultaneously. That is why the promoted state does not influence the boosted state.
https://developers.facebook.com/bugs/854544994579143/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With