2

I am using the Facebook marketing api to create a campaign, adset, creative and ads and I am using the PHP sdk 3.0 to manage them in Facebook.

I can create them successfully. Here is code to create a campaign:

$fields = array();
$params = array(
    'name' => 'API Test - vish',
    'objective' => 'CONVERSIONS',
    'status' => 'PAUSED',
);
try{
    $campaign = $this->ad_account->createCampaign($fields,$params);
} catch (Exception $e) {
    throw new Exception($e->getMessage());
}

echo $campaign->id;

I want to update details of a campaign.

I did some research and found this link, which states, that it is possible to update campaign details, but it does not provide a correct way to do it.

Anybody please let me know how I can update Facebook campaign details using its api.

Philipp Maurer
  • 2,480
  • 6
  • 18
  • 25
Vish
  • 111
  • 1
  • 13

1 Answers1

3

I know it is old question but I had the same issue and I've solved it this way:

$campaign = new Campaign($campaignId);
$campaign->updateSelf($fields, $params); // in $params are updated properties

Maybe it will help someone.

mavit
  • 31
  • 3