我们不再支持通过 API 对现有帖子使用版位素材定制功能。您只能在广告管理工具中使用此选项。
使用 asset_feed_spec
提供创意。您可以为每种素材类型(包括图片、视频、轮播、标题和正文)指定多个创意素材。仅提供一个链接描述,因为无法针对每个版本自定义链接描述。
如要应用定制功能:
asset_feed_spec
中设置 asset_customization_rules
。 customization_spec
和素材标签。 对于版位素材定制,需为每个 asset_feed_spec
都附加不少于一条的定制规则。
请参阅素材定制规则。
属性名称 | 描述 |
---|---|
类型:支持的字段 | 必要。 要显示素材的版位。 |
格式: | 对于 要显示的图片的标签。该标签应附加到 |
格式: | 对于 要显示的视频的标签。该标签应附加到 |
| 对于 要显示的轮播的标签。该标签应附加到 注意:如果通过版位素材定制提供轮播,所有子附件都必须在素材信息库参数中进行定义,并通过广告标签来引用。不能在素材内定义子附件。有关 |
customization_spec
中支持的字段属性名称 | 描述 |
---|---|
| 必要。 广告可用的版位。选项: |
| 非必要,但如果 Facebook 的专属版位。选项: |
| 非必要,但如果 Instagram 的专属版位。选项: 注意: |
| 非必要,但如果 Messenger 的专属版位。选项: |
| 非必要,但如果 Audience Network 的专属版位。选项: |
详细了解可用版位选项。
示例 — 信息库设置
curl \
-F 'object_story_spec={
"page_id": "<PAGE_ID>",
"instagram_actor_id": "<INSTAGRAM_ACTOR_ID>",
}' \
-F 'asset_feed_spec={
"videos": [
{
"adlabels": [
{
"name": "labelfb"
}
],
"video_id": "<VIDEO_ID>"
},
{
"adlabels": [
{
"name": "labelig"
}
],
"video_id": "<VIDEO_ID>"
}
],
"bodies": [
{
"text": "Begin Your Adventure"
}
],
"link_urls": [
{
"website_url": "<WEBSITE_URL>",
"display_url": "<DISPLAY_URL>"
}
],
"titles": [
{
"text": "Level Up"
}
],
"ad_formats": [
"SINGLE_VIDEO"
],
"call_to_action_types": [
"WATCH_MORE"
],
"descriptions": [
{
"text": "Description"
}
],
"asset_customization_rules": [
{
"customization_spec": {
"publisher_platforms": [
"facebook"
],
"facebook_positions": [
"feed",
"instream_video"
]
},
"video_label": {
"name": "labelfb"
}
},
{
"customization_spec": {
"publisher_platforms": [
"instagram"
],
"instagram_positions": [
"stream"
]
},
"video_label": {
"name": "labelig"
}
}
]
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/act_<AD_ACCOUNT_ID>/adcreatives
示例 — Instagram 发现首页素材定制
curl \
-F 'object_story_spec={
"page_id": "<PAGE-ID>",
"instagram_actor_id": "<INSTAGRAM-ID>",
}' \
-F 'asset_feed_spec={
"ad_formats": [
"SINGLE_IMAGE"
],
"asset_customization_rules": [
{
"image_label": {
"name": "<IMAGE-LABEL>"
},
"customization_spec": {
"publisher_platforms": [
"instagram"
],
"instagram_positions": [
"explore_home"
]
}
}
],
"bodies": [
{
"text": "",
"adlabels": [
{
"name": "adlabel1"
},
{
"name": "adlabel2"
}
]
}
],
"call_to_action_types": [
"LEARN_MORE"
],
"images": [
{
"hash": "<IMAGE-HASH>",
"adlabels": [
{
"name": "adlabel1"
}
]
},
{
"hash": "<IMAGE-HASH>",
"image_crops": {
"100x100": [
[
604,
0
],
[
1659,
1055
]
]
},
"adlabels": [
{
"name": "adlabel2"
}
]
}
],
"link_urls": [
{
"website_url": "",
"display_url": "",
"deeplink_url": "",
"adlabels": [
{
"name": "adlabel1"
},
{
"name": "adlabel2"
}
]
}
],
"optimization_type": "PLACEMENT",
"titles": [
{
"text": "",
"adlabels": [
{
"name": "adlabel1"
},
{
"name": "adlabel2"
}
]
}
]
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/act_<AD_ACCOUNT_ID>/adcreatives
示例 — Instagram 搜索结果素材定制
curl
-F 'object_story_spec={
"page_id": "<PAGE-ID>",
"instagram_actor_id": "<INSTAGRAM-ID>",
}' \
-F 'asset_feed_spec={
"ad_formats": [
"SINGLE_IMAGE"
],
"asset_customization_rules": [
{
"image_label": {
"name": "placement_asset_f1048d832ecd558_1661539731099"
},
"customization_spec": {
"publisher_platforms": [
"instagram"
],
"instagram_positions": [
"ig_search"
]
}
}
],
"bodies": [
{
"text": "",
"adlabels": [
{
"name": "adlabel1"
},
{
"name": "adlabel2"
}
]
}
],
"call_to_action_types": [
"LEARN_MORE"
],
"images": [
{
"hash": "9ffd7307eae1f9c6e5250fc8760d285f",
"adlabels": [
{
"name": "adlabel1"
}
]
},
{
"hash": "9ffd7307eae1f9c6e5250fc8760d285f",
"image_crops": {
"100x100": [
[
604,
0
],
[
1659,
1055
]
]
},
"adlabels": [
{
"name": "adlabel2"
}
]
}
],
"link_urls": [
{
"website_url": "<WEBSITE_URL>",
"display_url": "<DISPLAY_URL>",
"deeplink_url": "<DEEPLINK_URL>",
"adlabels": [
{
"name": "adlabel1"
},
{
"name": "adlabel2"
}
]
}
],
"optimization_type": "PLACEMENT",
"titles": [
{
"text": "",
"adlabels": [
{
"name": "adlabel1"
},
{
"name": "adlabel2"
}
]
}
]
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/act_<AD_ACCOUNT_ID>/adcreatives
对于版位素材定制广告,应通过 {ad-account-id}/ads
来检索 Instagram 相关的创意字段。例如:
https://graph.facebook.com/v21.0
/{ad-account-id}/ads?fields=creative{effective_instagram_story_id,instagram_permalink_url}