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:

  1. facebook-php-ads-sdk , run adgroup_creation.php , curl_log.php data, without success.

  2. facebook-php-sdk-v4 suppose less specific previous one.

  3. multi-product ads facebook marketing post -> developers.facebook.com/ads/blog/post/2015/03/26/creating-multi-product-ads/

  4. 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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -