与以custom audience
为目标不同,使用Facebook Ads API创建针对saved audience
的广告似乎是不可能的。有人能确认一下吗?什么是解决办法?这是我正在犯的错误:
Error #100: Param targeting[custom_audiences][id] must be a valid custom audience id
saved audience
和custom audience
是有区别的。saved audience
是您手动创建的指定年龄范围、地理区域和兴趣的受众。custom audience
是您收集的客户列表(上传或访问者或站点等)。您可以通过Ads Manager界面手动创建这些受众:
使用图API资源管理器,可以检索saved audiences
,如下所示:
act_1234567890/saved_audiences
使用图API资源管理器,可以检索custom audiences
,如下所示:
act_123456789/customaudiences
请注意,123456789
不是我的真实帐号。为了安全起见我改变了它。
因此,我可以检索custom audiences
和saved audiences
的I,并创建一个针对custom audience
的广告,这与针对提供上述错误消息的saved audience
不同。
一个麻烦的解决方法可能是在本地保存每个saved audience
的saved audience
,并在创建广告时使用该规范。问题是,一些targeting segments
变得无效(Facebook决定在随机时间停止某些片段),这会导致Facebook API出现问题。此外,这意味着我经常需要保持saved audiences
与本地副本保持同步。当然,除非我动态检索并重用targeting
的saved audience
,否则每次我创建广告时都会产生另一个API请求。
发布于 2017-07-04 15:15:24
我自己想出来的。与saved audience
不同的是,直接瞄准custom audience
似乎是不可能的,这是很奇怪的。我所做的是首先从保存的受众中检索targeting
,并在创建广告时重用该目标。
在这里,您可以看到只显示custom audiences
和lookalike audiences
的官方文档的屏幕截图。
从targeting
检索saved audience
(使用Facebook ):
$api = Api::instance();
use FacebookAds\Http\Request;
$response = $api->call(
"/987654321", 'GET',
array('fields'=>'targeting')
);
$audience = $response->getContent();
以987654321作为保存的观众ID。
然后将该目标复制到广告中(使用Facebook ):
use FacebookAds\Object\Targeting;
use FacebookAds\Object\Fields\TargetingFields;
$targeting = new Targeting();
$targeting->setData($audience['targeting']);
这种技术的缺点是,当saved audience
被更新时,广告不会被更新,它需要一个额外的API调用,这会减慢广告的创建速度。
https://stackoverflow.com/questions/44825552
复制