我已经阅读了很多关于facebook广告和东西的内容,使用GUI它可以做我正在做的事情,并且出于某种原因,它没有.
我在Facebook广告sdk子代码1487930上得到了这个suberror代码.
消息说:
您必须选择要推广的对象,用户消息说明:您的广告系列必须>包含一个广告集,其中包含与您的目标相关的所选对象>>(例如:页面,网址,事件).请更新您的广告集以继续.
响应不返回任何字段,并且在创建广告素材时发生错误: $creative->create();
我设置我的adset是这样的:
use Facebook;
use FacebookAds\Api;
use FacebookAds\Object;
use Facebook\Exceptions;
$inventory = new Models\AdvertisingInventory();
$item = $inventory->getListing($id)->getAttributes();
$item['properties'] = json_decode($item['properties'], true);
/**
* Step 1 Instantiate an API
*
* @link https://developers.facebook.com/docs/marketing-api/sdks#init-sdk
*/
try {
Api::init($this->app_id, $this->app_secret, $this->access_token);
} catch (\Exception $e) {
return $this->AdvertisingRenderErrorMessage($e);
}
/**
* Step 2 Query to create campaign
* @var $campaign
* @link https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group
*
* TODO: Implement ad image widget sizing: https://www.facebook.com/business/help/103816146375741
*/
try …Run Code Online (Sandbox Code Playgroud) facebook facebook-graph-api facebook-ads-api facebook-php-sdk