检查拒登状态的给定广告组列表(ad_group ID列表)以及获取拒登原因的最佳和最佳方式是什么?
最直接但不是最佳的方式是:
1)获取该帐户的所有被拒登的广告组:
params = {
'status': ['DISAPPROVED'],
'limit': 1000
}
adgroup_iter = account.get_ad_groups(params=params)
disapproved_ad_ids = []
for adgroup in adgroup_iter:
disapproved_ad_ids.append(adgroup._data['id'])
2)从结果列表中通过交叉列表仅选择感兴趣的ad_group:
ads_of_interest = list(set(ad_ids_to_check) & set(disapproved_ad_ids))
3)因为不合理的原因(adgroup_review_feedback字段)请求每个感兴趣的ad_group:
for adgroup_id in ads_of_interest:
adgroup = AdGroup(adgroup_id)
print adgroup.remote_read(fields=[AdGroup.Field.adgroup_review_feedback])
我运行了很多广告并且做出单独的API调用以获得他们每个人的拒绝原因是不好的,因为它只是让我超出了facebook请求限制。
结束解决方案:
params = {
'adgroup_status': ['DISAPPROVED'],
'limit': 500,
'fields': 'id,adgroup_review_feedback'
}
然后查找结果的交叉点和“有趣”广告列表,丢弃我问题的第3段,因为所需的数据已包含在第1个结果中(感谢@Igy回答)
提及 'adgroup_status'
字段名称而不是'status'
(在我的问题中给出) - 这解决了错误的Facebook响应问题。可能是因为它在SDK v.2.2.6中不起作用而在“获取广告广告帐户的所有广告......”示例中的documentation中的拼写错误
答案 0 :(得分:1)
无需单独提取每个广告
您可以在最初提取列表时请求adgroup_review_feedback
字段以及您感兴趣的其他字段
以下是我自己帐户中的一个示例,已删除ID:
/v2.2/act_<ACCOUNT_ID>/adgroups
?adgroup_status=['DISAPPROVED']
&fields=id,adgroup_review_feedback
响应:
{
"data": [
{
"id": "<REMOVED>",
"adgroup_review_feedback": {
"TEXT_OVERLAY": "Your ad wasn't approved because it uses too much text in its image or video thumbnail, which doesn't follow Facebook's ad guidelines. Ad images or video thumbnails aren't allowed to include more than 20% text. You'll still be charged for any impressions or clicks your ad received before it was disapproved. You may upload your ad image to see why it is considered 20% text, or visit the Help Center to learn more.If you’ve read the guidelines in the Help Center and think your ad follows the rules and should have been approved, please let us know."
}
},
{
"id": "<REMOVED>",
"adgroup_review_feedback": {
"TEXT_OVERLAY": "Your ad wasn't approved because it uses too much text in its image or video thumbnail, which doesn't follow Facebook's ad guidelines. Ad images or video thumbnails aren't allowed to include more than 20% text. You'll still be charged for any impressions or clicks your ad received before it was disapproved. You may upload your ad image to see why it is considered 20% text, or visit the Help Center to learn more.If you’ve read the guidelines in the Help Center and think your ad follows the rules and should have been approved, please let us know."
}
}
],
"paging": {
"cursors": {
"before": "<REMOVED>==",
"after": "<REMOVED>=="
}
}
}
使用问题中的代码作为示例,看起来它会打印出所有被拒登广告的拒登原因 - 强烈建议您不要使用1000作为首次提取的限制,但您可能会开始查看超时,因为帐户会随着时间的推移添加许多广告
params = {
'status': ['DISAPPROVED'],
'limit': 1000,
'fields': 'id,adgroup_review_feedback'
}
adgroup_iter = account.get_ad_groups(params=params)
for adgroup in adgroup_iter:
print adgroup(adgroup_review_feedback)