'; $app_secret = ''; $app_id = ''; $id = ''; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( 'name' => 'My Ad Set', 'optimization_goal' => 'LINK_CLICKS', 'billing_event' => 'LINK_CLICKS', 'bid_amount' => '2', 'daily_budget' => '1000', 'campaign_id' => '', 'targeting' => array('device_platforms' => array('mobile'),'geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook','audience_network'),'facebook_positions' => array('feed')), ); echo json_encode((new AdAccount($id))->createAdSet( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);