此解決方案讓您可根據地理位置目標設定類型自訂廣告素材。如要為不同版位自訂廣告素材,請參閱版位素材自訂。
族群素材自訂是使用自訂素材規則的三種 API 之一。詳情請參閱自訂素材規則。
隨著推廣 API v8.0 版推出,與地理位置無關的所有使用案例均已停用,無法用於族群素材自訂。現在,所有目標設定規則都必須在其自訂規格中包含地理位置資訊。惟預設規則除外,此類規則無需包含地理位置資訊。
您可根據地理位置自訂廣告,只需使用自訂規格來建立規則即可。支援的自訂類型如下:
用於指定自訂規格的格式與核心目標設定格式類似,詳情請參閱目標設定。
自訂素材規則讓您可將同時出現在指定地理位置的素材分為一組。每個規則都有一個 customization_spec
,用於定義哪些地理位置的用戶可在廣告刊登時查看這些素材。
建立規則時,您可為規則指定優先順序,否則我們會根據每個規則在所提供規則清單中的位置,為其各自分配優先順序編號。例如,我們會為清單中的第一個規則分配優先順序 1
。
為免系統向不符合任何規則的用戶刊登隨機組合的素材,您應設定預設規則。設定步驟如下:
customization_spec
。在規則最後使用開關大括號 {}
。預設規則可為不符合優先順序在其之前的任何規則之用戶配對創意素材。
設定規則時,非預設規則應配對予大部分目標廣告受眾。
建立 asset_feed_spec
,然後在 asset_customization_rules
欄位新增自訂規則。您最多可以加入 50 項自訂規則。
您必須為每一項規則指定 customization_spec
、priority
與素材標籤。單項規則的 customization_spec
所包含條件不能超過 50 個。
素材摘要設定範例:
curl \ -F 'object_story_spec={ "page_id": "<YOUR_PAGE_ID>", "instagram_actor_id" : "<INSTAGRAM_ACTOR_ID>" }' \ -F 'asset_feed_spec={ "images": [ {"hash":"<IMAGE_HASH>", "adlabels":[{"name":"image1"}]}, {"hash":"<IMAGE_HASH>", "adlabels":[{"name":"image2"}]} ], "bodies": [ {"text":"Motor City Mission Corps", "adlabels":[{"name":"body1"}]} ], "titles": [ {"text":"Link title 1 goes here", "adlabels":[{"name":"title1"}]}, {"text":"Link title 2 goes here", "adlabels":[{"name":"title2"}]}, {"text":"Link title 3 goes here", "adlabels":[{"name":"title3"}]} ], "call_to_action_types":[ "LEARN_MORE" ], "descriptions": [ {"text":"Begin Your Adventure"} ], "ad_formats": [ "SINGLE_IMAGE" ], "link_urls": [ {"website_url":"https://www.example.com/"} ], "asset_customization_rules": [ { "customization_spec": { "geo_locations": { "countries": ["US"] } }, "image_label": {"name": "image1"}, "title_label": {"name": "title1"}, "priority": 1 }, { "customization_spec": { "geo_locations": { "countries": ["GB"] } }, "image_label": {"name": "image1"}, "title_label": {"name": "title2"}, "priority": 2 }, { "customization_spec": { "geo_locations": { "cities": [ {"key": "2481714"}, {"key": "2481868"} ] } }, "image_label": {"name": "image1"}, "title_label": {"name": "title3"}, "priority": 4 }, { "customization_spec": {}, "image_label": {"name":"image2"}, "title_label": {"name":"title1"}, "priority": 5 }]}' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcreatives
查看素材摘要的所有可用選項。如要了解後續步驟,請參閱自訂素材規則。
使用 /generatepreview
端點來預覽廣告的不同目標設定規則版本。您還可以新增帶有規則優先順序編號的 dynamic_asset_label
欄位,以查看特定的語言版本。
舉例來說,如要預覽優先順序為 1 的規則:
curl -G --data-urlencode 'creative={ "object_story_spec": { "page_id": "<PAGE_ID>" }, "asset_feed_spec": { ... "asset_customization_rules": [ { "customization_spec": { "geo_locations": { "countries": ["US"] } }, "image_label": { "name": "image1" }, "title_label": { "name": "title1" }, "priority": 1 }, ... ] } }' -d 'ad_format=DESKTOP_FEED_STANDARD' -d 'dynamic_asset_label=1' -d 'access_token=<ACCESS_TOKEN>' https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/generatepreviews
特殊廣告類別 — 若是刊登房屋、招聘和信用卡廣告的美國廣告客戶,或是向美國用戶刊登廣告的廣告客戶,則須受不同的限制約束。這些廣告客戶必須遵守特殊廣告類別對於 asset_feed_spec
的限制。進一步了解特殊廣告類別。
宣傳活動,目標驗證 — 不支援 APP_ENGAGEMENT
。
支援的版位 — 支援所有版位。
版位自訂 — 如果有任何一項規則使用了版位自訂,則所有規則都應包含版位自訂。
asset_feed_spec
限制與基於素材摘要且沒有自訂規則的廣告之限制相同。惟以下限制除外:
asset_customization_rule
只能顯示一張圖片或一段影片。ad_formats
有兩種:SINGLE_IMAGE
和 SINGLE_VIDEO
。每個素材摘要只能有一種 ad_format
。call_to_actions_types
中提供一個項目。asset_customization_rule
。