php - facebook api marketing create campaign issue -
i create campaign using facebook api. tried run available example without success.
first of created app in order have app_id , app_secret.
i did procedure add ad_account following tutorial.
i downloaded sdk facilitate facebook api use like:
facebook-php-ads-sdk , run adgroup_creation.php , curl_log.php data, without success.
facebook-php-sdk-v4 suppose less specific previous one.
multi-product ads facebook marketing post -> developers.facebook.com/ads/blog/post/2015/03/26/creating-multi-product-ads/
the developers reference -> developers.facebook.com/docs/reference/php/4.0.0
i used "composer" dependency.
in case had problem create campaign using more or less code:
$campaign = new \facebookads\object\adcampaign(null,"act_$account_id"); $campaign->setdata(array( adcampaignfields::name => 'my first campaign', adcampaignfields::objective => adobjectives::website_clicks, adcampaignfields::status => adcampaign::status_paused )); // problem here $campaign->create();
any help? how can more useful error?
it's difficult without knowing exact error. however, try this: before creating campaign, initialize api using:
api::init(<your_app_id>, <your_ap_secret>, <your_token>);
(you need load facebookads\api use function).
Comments
Post a Comment