Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boosting a Facebook post via API and having it reflect in the FB UI

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.

enter image description here

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,
]);
like image 202
ceejayoz Avatar asked Oct 19 '22 03:10

ceejayoz


1 Answers

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/

like image 62
noetix Avatar answered Oct 30 '22 00:10

noetix