通过 asset_feed_spec
字段,您可以向不同用户投放广告创意的不同组合。您可以通过以下两种方式设置广告创意组合:
素材信息库参数由一系列不同的创意元素组成,例如图片、标题和正文等。您可以为每种素材类型指定多个创意素材。素材信息库参数的格式因用例而异。另请参阅参考文档 > 素材信息库参数。
您可以使用 asset_feed_spec
来提供多个创意素材,但是需要遵循以下限制:
asset_feed_spec
中加入至少两条目标定制规则。 asset_feed_spec
中加入定制规则。在这种情况下,您可以在 ad_formats
下指定 [“AUTOMATIC_FORMAT”]
,从而在不同版位将图片和视频混合使用。例如,如要创建用于动态素材的 asset_feed_spec
,可使用以下代码:
curl -X POST \
-F 'name="Dynamic Ad Creative with Asset Feed Spec Sample"' \
-F 'object_story_spec={
"page_id": "<PAGE_ID>"
}' \
-F 'asset_feed_spec={
"images": [
{
"hash": "<IMAGE_HASH>"
}
],
"bodies": [
{
"text": "Begin Your Adventure"
},
{
"text": "Once a Trainer, always a Trainer."
}
],
"titles": [
{
"text": "Level Up"
},
{
"text": "Swipe to evolve"
}
],
"descriptions": [
{
"text": "First Dynamic Ad Creative Sample"
}
],
"ad_formats": [
"SINGLE_IMAGE"
],
"call_to_action_types": [
"SHOP_NOW"
],
"link_urls": [
{
"website_url": "https://www.example.com/"
}
],
"videos": []
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/act_<AD_ACCOUNT_ID>/adcreatives
您也可以创建包含两个备选视频、两个备选正文和两个备选标题的 asset_feed_spec
:
curl \ -F 'object_story_spec={ "page_id": "YOUR_PAGE_ID" "instagram_actor_id" : "INSTAGRAM_ACTOR_ID", }' \ -F "asset_feed_spec={'videos': [{'video_id':'2053108854721025', 'thumbnail_url':'<thumnail_url>', 'url_tags':'video=video1'},{'video_id':'2104406249780616', 'thumbnail_url':'<thumnail_url>','url_tags':'video=video2'}], 'bodies': [{'text':'Begin Your Adventure'}, {'text':'Once a Trainer, always a Trainer.'}], 'titles': [{'text':'Level Up'}, {'text':'Swipe to evolve'}], 'descriptions': [{'text':'Begin Your Adventure'}], 'ad_formats': ['SINGLE_IMAGE'], 'link_urls': [{'website_url':'<WEBSITE_URL>'}]}" \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcreatives
如要检查您的创意,请读取 asset_feed_spec
:
curl -X GET \
-d 'fields="asset_feed_spec"' \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/<CREATIVE_ID>/
如果您的动态素材信息库包含多个图片和正文,响应将如下所示:
{ "asset_feed_spec":{ "images":[ { "url_tags":"image=image1", "hash":"785095162a2034666e0d0cc4ea1faf89" }, { "url_tags":"image=image2", "hash":"3a24122c13923569599be35567ce4e9e" } ], "bodies":[ { "text":"Begin Your Adventure" }, { "text":"Once a Trainer, always a Trainer." } ], "call_to_action_types":[ "LEARN_MORE" ], "call_to_actions":[ { "type":"LEARN_MORE" } ], "descriptions":[ { "text":"Begin Your Adventure" } ], "link_urls":[ { "website_url":"<WEBSITE_URL>" } ], "titles":[ { "text":"Swipe to evolve" }, { "text":"Level Up" } ], "ad_formats":[ "SINGLE_IMAGE" ], "optimization_type":"REGULAR" }, "id":"<AD_CREATIVE_ID>", }
如果您的动态素材信息库包含多个视频、正文和标题,响应将如下所示:
{ "asset_feed_spec":{ "videos":[ { "url_tags":"video=video1", "video_id":"2053108854721025", "thumbnail_url":"<thumnail_url>", "thumbnail_hash":"<thumnail_hash>" }, { "url_tags":"video=video2", "video_id":"2104406249780616", "thumbnail_url":"<thumnail_url>", "thumbnail_hash":"<thumnail_hash>" } ], "bodies":[ { "text":"Begin Your Adventure" }, { "text":"Once a Trainer, always a Trainer." } ], "call_to_action_types":[ "LEARN_MORE" ], "call_to_actions":[ { "type":"LEARN_MORE" } ], "descriptions":[ { "text":"Begin Your Adventure" } ], "link_urls":[ { "website_url":"<WEBSITE_URL>" } ], "titles":[ { "text":"Swipe to evolve" }, { "text":"Level Up" } ], "ad_formats":[ "SINGLE_VIDEO" ], "optimization_type":"REGULAR" }, "id":"<AD_CREATIVE_ID>", }
您可以添加、替换或移除任何创意素材。如要执行该操作,请使用新的 asset_feed_spec
提供另一个创意。
您可以:
您不能执行以下操作:
SINGLE IMAGE
更改为 VIDEO
。asset_feed_spec
的非动态素材广告。
curl \
-F 'access_token=<ACCESS_TOKEN>' \
-F 'creative={
"creative_id": <CREATIVE_ID>,
}' \
https://graph.facebook.com/v21.0
/<AD_ID>
在创建用于替换旧广告创意的新广告创意时,您仍然必须满足所有适用的限制条件。