使用Facebook API创建带投放资产自定义的轮播广告创意报错求助
问题描述
尝试通过Facebook API创建轮播广告创意,利用Placement Asset Customization针对不同投放位置(如Facebook Stories和Instagram Feed)自定义轮播图,使用Payload时遇到以下错误:
"error_user_title":"Invalid Targeting Rule For Localization By Location Ad","error_user_msg":"All non-default target rules must contain geolocation customization."
错误提示要求添加地理位置自定义,但相关文档显示该功能已废弃。若在customization_spec中添加:
"geo_locations": { "countries": ["US"] }
API返回:
Segment Asset Customization API has been deprecated from v22 and onwards. To unblock creative creation, please remove Segment Asset Customization setup and retry your request
无论是否添加地理位置自定义均报错,求解决方法。
原请求Payload
{ "images": [ { "hash": "some_hash", "adlabels": [ { "name": "image_0" } ] }, { "hash": "some_hash", "adlabels": [ { "name": "image_1" } ] }, { "hash": "some_hash", "adlabels": [ { "name": "image_2" } ] }, { "hash": "some_hash", "adlabels": [ { "name": "image_3" } ] }, { "hash": "some_hash", "adlabels": [ { "name": "image_4" } ] }, { "hash": "some_hash", "adlabels": [ { "name": "image_5" } ] } ], "titles": [ { "text": "Title 556ee", "adlabels": [ { "name": "title_0" } ] }, { "text": "Title e3af0", "adlabels": [ { "name": "title_1" } ] }, { "text": "Title 24511", "adlabels": [ { "name": "title_2" } ] }, { "text": "Title ded0a", "adlabels": [ { "name": "title_3" } ] }, { "text": "Title f288a", "adlabels": [ { "name": "title_4" } ] }, { "text": "Title 7ba5d", "adlabels": [ { "name": "title_5" } ] } ], "descriptions": [ { "text": "Description 556ee", "adlabels": [ { "name": "descr_0" } ] }, { "text": "Description e3af0", "adlabels": [ { "name": "descr_1" } ] }, { "text": "Description 24511", "adlabels": [ { "name": "descr_2" } ] }, { "text": "Description ded0a", "adlabels": [ { "name": "descr_3" } ] }, { "text": "Description f288a", "adlabels": [ { "name": "descr_4" } ] }, { "text": "Description 7ba5d", "adlabels": [ { "name": "descr_5" } ] } ], "carousels": [ { "adlabels": [ { "name": "carousel_0" } ], "child_attachments": [ { "image_label": { "name": "image_0" }, "title_label": { "name": "title_0" }, "description_label": { "name": "descr_0" }, "link_url_label": { "name": "link_url_0" } }, { "image_label": { "name": "image_1" }, "title_label": { "name": "title_1" }, "description_label": { "name": "descr_1" }, "link_url_label": { "name": "link_url_0" } }, { "image_label": { "name": "image_2" }, "title_label": { "name": "title_2" }, "description_label": { "name": "descr_2" }, "link_url_label": { "name": "link_url_0" } } ], "multi_share_end_card": false, "multi_share_optimized": false }, { "adlabels": [ { "name": "carousel_1" } ], "child_attachments": [ { "image_label": { "name": "image_3" }, "title_label": { "name": "title_3" }, "description_label": { "name": "descr_3" }, "link_url_label": { "name": "link_url_0" } }, { "image_label": { "name": "image_4" }, "title_label": { "name": "title_4" }, "description_label": { "name": "descr_4" }, "link_url_label": { "name": "link_url_0" } }, { "image_label": { "name": "image_5" }, "title_label": { "name": "title_5" }, "description_label": { "name": "descr_5" }, "link_url_label": { "name": "link_url_0" } } ], "multi_share_end_card": false, "multi_share_optimized": false } ], "call_to_action_types": [ "LEARN_MORE" ], "link_urls": [ { "adlabels": [ { "name": "link_url_0" } ], "website_url": "https://www.example.com/" } ], "ad_formats": [ "CAROUSEL" ], "asset_customization_rules": [ { "customization_spec": { "publisher_platforms": [ "facebook" ], "facebook_positions": [ "story" ] }, "carousel_label": { "name": "carousel_0" } }, { "customization_spec": {}, "carousel_label": { "name": "carousel_1" } } ] }
解决方法
1. 替换废弃的Segment Asset Customization方案
从v22版本开始,Segment Asset Customization API已被废弃,不能再使用asset_customization_rules结合地理位置或投放位置进行资产自定义。需改用拆分广告组的方式实现不同位置的创意自定义。
2. 调整Payload与广告结构
移除原Payload中的asset_customization_rules字段,保留所有创意资产(图片、标题、轮播等)。然后为每个目标投放位置创建独立的广告组,分别关联对应的轮播创意:
修改后的创意Payload
{ "images": [ // 保留原有图片配置 ], "titles": [ // 保留原有标题配置 ], "descriptions": [ // 保留原有描述配置 ], "carousels": [ // 保留两个轮播配置 ], "call_to_action_types": [ "LEARN_MORE" ], "link_urls": [ // 保留原有链接配置 ], "ad_formats": [ "CAROUSEL" ] }
对应广告组配置示例
- Facebook Stories 广告组
{ "name": "Facebook Stories 轮播广告组", "campaign_id": "<你的广告系列ID>", "bid_amount": "100", "targeting": { // 你的定向设置 }, "placements": { "publisher_platforms": ["facebook"], "facebook_positions": ["story"] }, "creative": { "creative_id": "<关联carousel_0的创意ID>" } }
- Instagram Feed 广告组
{ "name": "Instagram Feed 轮播广告组", "campaign_id": "<你的广告系列ID>", "bid_amount": "100", "targeting": { // 你的定向设置 }, "placements": { "publisher_platforms": ["instagram"], "instagram_positions": ["feed"] }, "creative": { "creative_id": "<关联carousel_1的创意ID>" } }
3. 错误原因说明
报错矛盾是API版本迭代导致的:旧逻辑要求非默认规则必须带地理位置,但新版本已废弃该功能模块,因此无论是否添加地理位置参数都会触发错误。拆分广告组关联对应创意是当前版本的合规实现方式。
内容的提问来源于stack exchange,提问作者LogicFlow




