【发布时间】:2018-01-29 09:45:48
【问题描述】:
我有一个 Facebook 活动、adSet 和一个我使用 Facebook API 创建的广告。但是,当我尝试使用这三个端点(:I think they are called endpoints) 创建广告时,会出现错误No creative spec found for given adgroup. 这是我使用之前创建的图片、广告集和广告系列创建广告的代码:
FB.api('act_xxxxxxxx/adcreatives', 'POST', {
name: 'My Testworthy Ad Creative',
title: 'Facebook Marketing Partners',
body: 'Get exactly the things you need from your marketing.',
image_url: 'img url',
object_url: 'https://www.facebookmarketingpartners.com',
access_token:'app access token for selected permissions'
},function(adcreativeresponse){
console.log(adcreativeresponse.id);
FB.api('/act_xxxxxxxx/ads','POST', {
creative:["{\"creative_id\" : \"adcreativeresponse.id /*or a static creative_id*/\"}"],
name:"tryncatch",
adset_id:"adsetId",
status:"PAUSED",
access_token:"app access token with the required permissions selected"},
function(response) {
console.log("response for ad");
console.log(response);//
Insert your code here
}
);
} );
如代码所示,我创建了一个adcreative,它返回创建的adcreative 的节点ID,我在response 函数中使用它来创建一个ad,其中包含之前收集的所有参数,但是它给了我一个错误,如登录"response for ad" 后提供的图像所示。
这里有什么我遗漏的吗?
【问题讨论】:
-
我有同样的问题,但在 Python 中。我提供
adset_id和creative,但得到相同的旧No creative spec found for given adgroup。当我找到任何答案时,我会更新 -
试试这个
"creative": {"creative_id":<CREATIVE_ID>}(不带数组) -
您好,Jun,我尝试不使用“[”“]”,然后出现错误,提示广告素材与广告不兼容。对你有用吗?
-
这正是经过一些更改后的内容:“广告组的创意与广告组所属的广告系列组的目标不兼容。” error_user_title : "Invalid Creative For Objective" 所以我需要以不同的方式发布 ad_creatives 或使用一些额外的参数创建我的广告集
-
是的。我的解决方案奏效了。您似乎试图将广告创意与配置通常不支持您感兴趣的创意的广告系列/广告集相关联。希望你能找到合适的组合:)
标签: javascript json facebook-graph-api facebook-apps facebook-marketing-api