本指南說明如何使用推廣 API 建立和發佈 Messenger 發訊廣告。
如要使用廣告管理員建立名單型廣告宣傳活動,請瀏覽 Meta 企業商家幫助中心。
用戶點擊您的 Messenger 發訊廣告後,系統會將用戶直接帶到 Messenger 中,讓他們與您的企業開始對話。您可以運用這種廣告大規模地接觸用戶,以及提供出色的個人化服務。
Messenger 發訊廣告支援在廣告中包含圖像、影片、輪播內容或微影片。您也可以在廣告中加入通話提示。
如果您有興趣建立廣告來將用戶帶到 Instagram 或 WhatsApp 中聊天,請參閱 Instagram 發訊廣告或 WhatsApp 發訊廣告以獲取有關指引。您還可以建立廣告來將用戶帶到最有可能吸引他們回應的應用程式,詳情請瀏覽多目的地發訊廣告。
建立和發佈廣告的步驟如下:
本指南假設您符合以下條件:
如要成功呼叫本指南中的所有端點,您需要以下項目:
ADVERTIZE
任務的用戶所要求ads_management
pages_manage_ads
pages_read_engagement
pages_show_list
如要建立廣告宣傳活動,您需向 act_ad_account_id/campaigns
端點傳送 POST
要求,其中 ad_account_id 即您的 Meta 廣告帳戶編號。您的要求必須包括以下內容:
|
|
curl -X POST "https://graph.facebook.com/v19.0
/act_ad_account_id/campaigns" \
-H "Content-Type: application/json" \
-d '{
"access_token":"Your_page_access_token",
"buying_type":"AUCTION",
"name":"Messenger_ad_campaign_name",
"objective":"OUTCOME_TRAFFIC",
"status":"PAUSED",
"special_ad_categories":["NONE"],
}'
成功的話,應用程式就會收到以下 JSON 回應,其中包含您宣傳活動的編號。
{ "id": "campaign_id" }
如要建立廣告組合,您需向 act_ad_account_id/adsets
端點傳送 POST
要求,其中 ad_account_id 即您的 Meta 廣告帳戶編號。您的要求必須包括以下內容:
access_token
bid_amount
billing_event
設為 IMPRESSIONS
campaign_id
daily_budget
destination_type
設為 MESSENGER
name
optimization_goal
設為 CONVERSATIONS
、IMPRESSIONS
、LEAD_GENERATION
或 QUALITY_LEAD
(適用於名單型廣告)promoted_object
:設定為您企業的 Facebook 專頁編號。贊助訊息必要項目status
設為 PAUSED
targeting
:使用贊助訊息時,需要在 device_platforms
中加入流動版和桌面版裝置
curl -X POST "https://graph.facebook.com/v19.0
/act_ad_account_id/adsets"
-H "Content-Type: application/json"
-d '{
"access_token":"Your_page_access_token",
"bid_amount":"Your_bid_amount",
"billing_event":"IMPRESSIONS",
"campaign_id":"Your_campaign_id",
"daily_budget":"Your_daily_budget",
"destination_type":"MESSENGER",
"name:"Your_messenger_adset_name",
"optimization_goal:IMPRESSIONS",
"status:PAUSED",
"targeting":{
"geo_locations": { "countries":["US","CA"] },
"device_platforms": ["mobile", "desktop"],
"publisher_platforms": ["messenger"]
}
}'
成功的話,您的應用程式就會收到以下 JSON 回應,其中包含廣告組合編號。
{ "id": "adset_id" }
透過建立廣告創意,您可以在廣告中加入各種素材。
限制
|
如要建立廣告創意,您需向 /act_ad_account_id/adcreatives
端點傳送 POST
要求,其中 ad_account_id 即您的 Meta 廣告帳戶編號。您的要求必須包括以下內容:
access_token
messenger_sponsored_message
:贊助訊息必要項目name
object_id
:贊助訊息必要項目object_story_spec
:必要項目object_type
:贊助訊息必要項目privacy_url
:名單型廣告必要項目standard_enhancements.enroll_status
:符合標準強化效果的廣告創意必要項目。 如要建立 Messenger 發訊廣告的廣告創意,您需向 /act_ad_account_id/adcreatives
端點傳送 POST
要求,其中 ad_account_id 即您的 Meta 廣告帳戶編號。您的要求必須包括以下內容:
access_token
name
object_story_spec
,帶有定義影音素材類型的 *_data
物件
curl -X POST "https://graph.facebook.com/v19.0
/act_ad_account_id/adcreatives"
-H "Content-Type: application/json"
-d '{
"access_token":"page_access_token",
"name":"Your_CTM_image_ad_name",
"object_story_spec":{
"page_id": "your_page_id",
"link_data": {
"page_welcome_message": "Your_welcome_message",
"image_hash": "Your_image_hash",
"link": "Your_image_URL",
"call_to_action": {
"type":"LEARN_MORE",
"value":{ "app_destination":"MESSENGER" }
}
}
}
}'
curl -X POST "https://graph.facebook.com/v19.0
/act_ad_account_id/adcreatives"
-H "Content-Type: application/json"
-d '{
"access_token": "page_access_token",
"name": "Your_CTM_image_ad_name",
"object_story_spec": {
"page_id": "your_page_id",
"video_data": {
"call_to_action": {
"type": "LEARN_MORE",
"value": { "app_destination": "MESSENGER" }
},
"link_description": "Your_link_description",
"image_url": "Your_thumbnail_URL",
"page_welcome_message": "Your_welcome_text",
"video_id": "video_id"
}
}
}'
curl -X POST "https://graph.facebook.com/v19.0
/act_ad_account_id/adcreatives"
-H "Content-Type: application/json"
-d '{
"access_token": "page_access_token",
"name": "Your_CTM_image_ad_name",
"object_story_spec": {
"page_id": "your_page_id",
"link_data": {
"image_hash": "your_image_hash",
"link": "your_image_URL",
"call_to_action": {
"type": "MESSAGE_PAGE",
"value": { "app_destination":"MESSENGER" }
}
}
},
"asset_feed_spec": {
"additional_data": {
"partner_app_welcome_message_flow_id": "FLOW-ID"
}
}
}'
如要進一步了解訊息應用程式流程,請參閱 Messenger 平台文件中的歡迎訊息流程。
點擊訂閱廣告是一種 Messenger 發訊廣告,其中 object_story_spec.page_welcome_message
是包含通知訊息範本的物件陣列。用戶點擊您廣告中的接收訊息按鈕,即表示其同意接收來自您企業的營銷訊息。
如要建立點擊訂閱廣告的廣告創意,您需向 /act_ad_account_id/adcreatives
端點傳送 POST
要求,其中 ad_account_id 即您的 Meta 廣告帳戶編號。您的要求必須包括以下內容:
access_token
name
object_story_spec
,帶有
*_data
物件 page_welcome_message
陣列,定義選擇接收營銷訊息要求。必須包含設為 marketing_messages
的 landing_screen_type
,以及設為 nofitication_messages
的訊息附件 payload.template_type
curl -X POST "https://graph.facebook.com/v19.0
/act_ad_account_id/adcreatives"
-H "Content-Type: application/json"
-d '{
"access_token": "page_access_token",
"name": "Your_CTS_image_ad_name",
"object_story_spec": {
"page_id": "your_page_id",
"link_data": {
"image_hash": "Your_image_hash",
"link": "Your_image_URL",
"call_to_action": {
"type": "LEARN_MORE",
"value":{ "app_destination": "MESSENGER" }
}
"page_welcome_message": "{
"landing_screen_type": "marketing_messages",
"media_type": "image",
"image_format": {
"customer_action_type": "buttons",
"message": {
"text": "Your_welcome_message",
"attachment": {
"type": "template",
"payload":{
"template_type":"notification_messages",
"elements": [{
"title": "Your_CTS_title",
"subtitle": "Your_CTS_subtitle",
"image_url": "Your_image_URL",
"app_id": "Your_Meta_app_ID",
"buttons": [{
"type": "postback",
"payload": "Data_to_include_in_webhook_notification",
"title": "Get messages"
}]
}]
}
}
}
}
}"
}
}
}'
Messenger 名單型廣告讓您能夠使用自動化聊天室範本,在 Messenger 中開發潛在顧客。您可以直接在您的首選訊息平台上,向對您企業感興趣的用戶提出具體問題,收集顧客喜好資訊並提出自訂問題,優先接觸最符合您要求的潛在顧客。
在建立 Messenger 名單型廣告的廣告創意之前,您必須接受 Messenger 名單型廣告的條款及細則。
如要建立訊息範本,您需向 /page_id/messenger_lead_forms
端點傳送 POST
要求,其中 page_id 即您企業的 Facebook 專頁編號。您的要求必須包括以下內容:
access_token
privacy_url
step_list
陣列,包含 message
、reply_type
、step_id
和 step_type
template_name
reminder_text
以下訊息範本包含您的 template_name
、privacy_url
、step_list
(包含 step_id: 0
中的歡迎訊息、step_id: 1
至 4
中的問題、step_id: 5
中的確認訊息,以及 step_id: 6
中的資格不符訊息)。
curl -X POST "https://graph.facebook.com/v19.0
/your_page_ID/messenger_lead_forms"
-H "Content-Type: application/json"
-d '{
"access_token": "Your_page_access_token",
"privacy_url": "Your_privacy_policy_URL",
"reminder_text": "Your_reminder_text",
"template_name": "Your_template_name",
"step_list": [
{
"step_id": "0",
"message": "Your_welcome_message",
"step_type": "INTRO",
"reply_type": "NONE",
"next_step_ids": "1"
},
{
"step_id": "1"
"message": "Are_you_interested_in_our_products_or_services?",
"step_type": "QUESTION",
"reply_type": "QUICK_REPLIES",
"answers": ["Yes", "Not now", "Maybe"],
"next_step_ids": [2,6,2],
"allow_to_skip": false,
"answer_validation_enabled": true
},
{
"step_id": "2",
"message": "What city do you live in?",
"step_type": "QUESTION",
"reply_type": "PREFILL",
"prefill_type": "CITY",
"next_step_ids": "3",
"allow_to_skip": true
},
{
"step_id": "3",
"message": "What is your phone number?",
"step_type": "QUESTION",
"reply_type": "PREFILL",
"prefill_type": "PHONE",
"next_step_ids": "4",
"allow_to_skip": false,
"answer_validation_enabled": true
},
{
"step_id": "4",
"message": "What is your email address?",
"step_type": "QUESTION",
"reply_type": "PREFILL",
"prefill_type": "EMAIL",
"next_step_ids": "5",
"allow_to_skip": false,
"answer_validation_enabled": true
},
{
"step_id": "5",
"message": "Your_confirmation_message",
"step_type": "CONFIRMATION",
"reply_type": "NONE"
},
{
"step_id": "6",
"message": "Your_disqualification_message",
"step_type": "DISQUALIFY",
"reply_type": "NONE"
}
]
}'
成功的話,應用程式就會收到以下 JSON 回應,其中包含範本編號。
{ "id": "your_messenger_lead_gen_template_id" }
在此過程中,您還需建立 fblead_form
並將其與訊息範本連結。
如要獲取 Messenger 名單型廣告表格範本清單,您需向 /page_id/messenger_lead_forms
端點傳送 GET
要求。此外,您還可以向 /
Your_messenger_lead_gen_template_id
端點傳送 GET
要求,以獲取有關特定範本的資訊。
如要建立名單型廣告的廣告創意,您需向 /act_
ad_account_id
/adcreatives
端點傳送 POST
要求,其中 ad_account_id
即您的 Meta 廣告帳戶編號。您的要求必須包括以下內容:
access_token
name
object_story_spec
,其中包含定義媒體類型、圖像或影片的 *_data
物件,並包括以下內容:
*_data.page_welcome_message
參數設定為鍵/值組
ctm_lead_gen_template_id:
Your_messenger_lead_gen_template_id
curl -X POST "https://graph.facebook.com/v19.0
/act_AD_ACCOUNT_ID/adcreatives"
-H "Content-Type: application/json"
-d '{
"access_token": "Your_page_access_token",
"degrees_of_freedom_spec": {
"creative_features_spec": {
"standard_enhancements": { "enroll_status": "OPT_IN" }
}
},
"name": "Your_lead_ad_image_ad_name",
"object_story_spec": {
"page_id": "Your_page_id",
"link_data": {
"call_to_action": {
"type": "MESSAGE_PAGE",
"value": { "app_destination": "MESSENGER" }
},
"description": "Sample_description",
"image_hash": "Your_image_hash",
"message": "Sample_message_for_Creative",
"page_welcome_message": "{ "ctm_lead_gen_template_id": "Your_messenger_lead_gen_template_id" }"
}
}
}'
curl -X POST "https://graph.facebook.com/v19.0
/act_AD_ACCOUNT_ID/adcreatives"
-H "Content-Type: application/json"
-d '{
"access_token": "Your_page_access_token",
"degrees_of_freedom_spec": {
"creative_features_spec": {
"standard_enhancements": { "enroll_status": "OPT_IN" }
}
},
"name": "Your_lead_ad_video_ad_name",
"object_story_spec": {
"page_id": "your_page_id",
"video_data": {
"call_to_action": {
"type": "MESSAGE_PAGE",
"value":{ "app_destination": "MESSENGER" }
},
"image_url": "Your_thumbnail_url",
"link_description": "Your_link_description ",
"message": "Sample message for Creative ",
"page_welcome_message": "{ "ctm_lead_gen_template_id": "Your_messenger_lead_gen_template_id" }",
"video_id": "Your_video_id"
}
}
}'
贊助訊息這類廣告會以訊息形式傳送至目前與您企業的 Facebook 專頁展開 Messenger 對話的所有帳戶管理中心帳戶。您亦可加入其他廣告目標設定條件,例如人口統計資料、地理位置資料、自訂廣告受眾或興趣。 必要條件
限制
|
如要建立贊助訊息的廣告創意,您的要求需包含 object_id
參數(設為您的 Facebook 專頁編號)、object_type
(設為 SHARE
)、messenger_sponsored_message
物件(其中 message.text
參數設為廣告文字),以及包含下列參數的 message.attachment
物件:
curl -X POST "https://graph.facebook.com/v19.0
/act_AD_ACCOUNT_ID/adcreatives"
-H "Content-Type: application/json"
-d '{
"access_token": "Your_page_access_token"
"object_id": "Your_page_id",
"object_type": "SHARE",
"messenger_sponsored_message": {
"message":{
"text":"Your_ad_creative_text",
"attachment":{
"type":"template",
"payload":{
"template_type":"generic",
"elements":[{
"title":"Your_image_text",
"image_hash":"Your_image_hash",
"buttons":[{
"type":"web_url",
"title":"Your_button_text",
"url":"Your_destination_URL"
}]
}]
}
}
}
}
}'
如要建立帶有快速回覆訊息的贊助訊息,您需設定 messenger_sponsored_message.message
物件,其中 text
設為您的問題或指令,並為每個快速回覆選項設定 quick_replies
陣列。
curl -X POST "https://graph.facebook.com/v19.0
/act_ad_account_id/adcreatives"
-H "Content-Type: application/json"
-d '{
"access_token": "Your_page_access_token"
"object_id": "Your_page_id",
"object_type": "SHARE",
"messenger_sponsored_message": {
"message":{
"text":"Your_ad_creative_text",
"quick_replies":[
{
"content_type": "text",
"title": "Your_reply_first_option_reply",
"payload": "Information_sent_via_postback_webhook_when_option_1_is_selected"
},
{
"content_type": "text",
"title": "Your_reply_second_option_reply",
"payload": "Information_sent_via_postback_webhook_when_option_2_is_selected"
}
]
}
}'
成功的話,您的應用程式就會收到以下 JSON 回應,其中包含廣告創意編號。
{ "id": "ad_creative_id" }
在建立廣告時,您需將廣告創意與廣告組合連結。如要建立廣告,請向 /act_ad_account_id/ads
端點傳送 POST
要求,其中 ad_account_id 即您的 Meta 廣告帳戶編號。您的要求必須包括以下內容:
curl -X POST "https://graph.facebook.com/v19.0
/act_ad_account_id/ads"
-H "Content-Type: application/json"
-d '{
"access_token": "Your_page_access_token",
"adset_id": "Your_ad_set_id",
"creative": { "creative_id": "Your_ad_creative_id" },
"status": "PAUSED"
}'
成功的話,您的應用程式就會收到以下 JSON 回應,其中包含廣告編號。
{ "id": "ad_id" }
您可以建立包含多個訊息素材的訊息,例如通話提示、多個範本等。您可以為 *_data.page_welcome_message
值設定物件陣列而非字串值,從而加入這些素材。
您可以將 *_data.page_welcome_message
的值設定為定義通話提示素材的物件陣列,從而為 Messenger 發訊廣告新增通話提示。將 landing_screen_type
參數設為 call_prompt
,media_type
設為 text
,帶有 text
的 text_format.message
物件設為您的歡迎訊息文字,以及 call_prompt_data.call_prompt_message
設為與您企業通話的話題引子。
... "page_welcome_message": "[ { "landing_screen_type": "call_prompt", "media_type": "text", "text_format": { "message": { "text": "Your_welcome_message", "call_prompt_data": { "call_prompt_message": "Your_call_prompt_message" } } }, } ]" ...
如要建立包含多個範本的廣告,您需將 *_data.page_welcome_message
參數設為帶有訊息範本 的陣列。下方範例展示如何新增快速回覆的範本。
... "page_welcome_message": "[{ 'message': { 'text':' Your_question_or_directive ', 'quick_replies':[ { 'content_type':'text', 'title':' Option_1 ', 'payload':' Option_1_information_for_webhook ' }, { 'content_type':'text', 'title':' Option_2 ', 'payload':' Option_2_information_for_webhook ' }, { 'content_type':'text', 'title':' Option_3 ', 'payload':' Option_3_information_for_webhook ' } ] } }]", ...
如未設定 Webhooks 以在用戶點擊廣告時接收通知,請加以設定。
深入了解推廣 API,以及 Messenger 發訊廣告和贊助訊息廣告的其他選項。