Messenger 發訊廣告

本指南說明如何使用行銷 API 來建立和發佈 Messenger 發訊廣告。

如果您想要使用廣告管理員建立名單型廣告行銷活動,請瀏覽 Meta 企業商家使用說明

Messenger 發訊廣告會將點擊廣告的用戶直接送到 Messenger 中,與商家進行對話。使用這類廣告可大量觸及用戶,並提供優質的個人化服務。

Messenger 發訊廣告支援附有圖像、影片、輪播或輕影片的廣告。您也可以在廣告中加入通話提示。

如果您有興趣建立將用戶傳送至 Instagram 或 WhatsApp 聊天室的廣告,請參閱 Instagram 發訊廣告WhatsApp 發訊廣告取得相關指南。您也可以建立選擇用戶最有可能回應的目的地廣告,請參閱多目的地發訊廣告,瞭解更多資訊。

廣告建立流程總覽

若要建立和發佈廣告,您需要執行以下步驟:

  1. 建立廣告行銷活動
  2. 建立將廣告連結至廣告行銷活動的廣告組合
  3. 針對您想要投放的 Messenger 廣告類型建立廣告創意
  4. 將廣告創意連結至廣告組合,以建立廣告
  5. 發佈廣告至 Facebook、Instagram 和 Messenger

準備工作

本指南假設您已經具備下列條件:

為了成功呼叫本指南中的端點,您需要:

  • 可在粉絲專頁上執行 ADVERTIZE 任務之用戶所要求的粉絲專頁存取權杖
  • 您的應用程式用戶必須授予下列權限:
    • ads_management
    • pages_manage_ads
    • pages_read_engagement
    • pages_show_list

步驟 1:建立行銷活動

若要建立廣告行銷活動,請傳送 POST 要求至 act_ad_account_id/campaigns 端點,其中 ad_account_id 是 Meta 廣告帳號的編號。您的要求必須包含:

  • access_token
  • buying_type
  • name
  • objective – 設為 OUTCOME_TRAFFIC,若要用於名單型廣告,則設為 OUTCOME_LEADS
  • special_ad_categories
  • status

廣告行銷活動快速參考資料

要求範例

採用方便閱讀的格式。將粗體、斜體值(例如 ad_account_id)換成您的值。
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"
}

步驟 2:建立廣告組合

若要建立廣告組合,請傳送 POST 要求至 act_ad_account_id/adsets 端點,其中 ad_account_id 是 Meta 廣告帳號的編號。您的要求必須包含:

  • access_token
  • bid_amount
  • billing_event 設為 IMPRESSIONS
  • campaign_id
  • daily_budget
  • destination_type 設為 MESSENGER
  • name
  • optimization_goal 設為 CONVERSATIONSIMPRESSIONS,若要用於名單型廣告,則設為 LEAD_GENERATIONQUALITY_LEAD
  • promoted_object 設為您的商家 Facebook 粉絲專頁編號贊助訊息的必要項目
  • status 設為 PAUSED
  • targeting – 贊助訊息需要 device_platforms 同時包含行動裝置和桌上型電腦

廣告組合快速參考資料

要求範例

採用方便閱讀的格式。將粗體、斜體值(例如 ad_account_id)換成您的值。
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"
}

步驟 3:建立廣告創意

廣告創意可讓您新增素材至廣告。

限制

  • 不支援使用 object_story_id 建立的廣告
  • 用戶必須在裝置上安裝 Messenger,才會看到您的廣告
  • 不支援右側廣告版位

若要建立廣告創意,請傳送 POST 要求至 /act_ad_account_id/adcreatives 端點,其中 ad_account_id 是 Meta 廣告帳號的編號。您的要求必須包含:

  • access_token
  • messenger_sponsored_message – 贊助訊息的必要項目
  • name
  • object_id – 贊助訊息的必要項目
  • object_story_spec – 必要項目
  • object_type – 贊助訊息的必要項目
  • privacy_url – 名單型廣告的必要項目
  • standard_enhancements.enroll_status – 符合標準強化效果資格之廣告創意的必要項目。

最高層級廣告創意參數快速參考資料

Messenger 發訊廣告

若要為 Messenger 發訊廣告建立廣告創意,請傳送 POST 要求至 /act_ad_account_id/adcreatives 端點,其中 ad_account_id 是 Meta 廣告帳號的編號。您的要求必須包含:

  • access_token
  • name
  • object_story_spec,包含定義影音素材類型的 *_data 物件

圖像廣告快速參考資料

圖像廣告要求範例

採用方便閱讀的格式。將粗體、斜體值(例如 page_access_token)換成您的值。
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" }
               }   
             }
           }
         }'          

Messenger 發訊廣告影片廣告快速參考資料

影片廣告要求範例

採用方便閱讀的格式。將粗體、斜體值(例如 page_access_token)換成您的值。
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"
             } 
           }
         }'

使用在合作夥伴應用程式中所配置之訊息傳送流程的廣告

採用方便閱讀的格式。將粗體、斜體值(例如 page_access_token)換成您的值。
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 開放平台文件中的歡迎訊息流程

點擊訂閱廣告

點擊訂閱廣告(CTS)為 Messenger 發訊廣告,其中 object_story_spec.page_welcome_message 是含有通知訊息範本的物件陣列。當用戶點擊您廣告中的「取得訊息」按鈕時,即表示該用戶同意接收您的商家發出的行銷訊息。

若要為點擊訂閱廣告建立廣告創意,請傳送 POST 要求至 /act_ad_account_id/adcreatives 端點,其中 ad_account_id 是 Meta 廣告帳號的編號。您的要求必須包含:

  • access_token
  • name
  • object_story_spec,包含
    • 定義影音素材類型的 *_data 物件
    • page_welcome_message 陣列,用來定義行銷訊息選擇接收要求。必須包含 landing_screen_type(設為 marketing_messages)和訊息附件 payload.template_type(設為 nofitication_messages

圖像廣告要求範例

採用方便閱讀的格式。將粗體、斜體值(例如 ad_account_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_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 名單型廣告建立廣告創意。

訊息範本需求

  • 歡迎訊息,可在用戶點擊您的廣告後向他們問候,並讓他們知道您的商家提供哪些商品或服務。
  • 可收集用戶是否為潛在顧客等相關資訊的問題。這些問題可以包括興趣、地點,以及電子郵件和電話號碼等聯絡資訊。
  • 確認訊息,讓您能夠感謝用戶回答問題,並讓他們知道接下來會發生哪些情況。您可以在廣告管理員、粉絲專頁發佈工具或 CRM 中找到您的新潛在顧客。
  • 隱私政策,因為您將會收集顧客資訊。

限制

  • 訊息範本建立後,就無法編輯或刪除

建立訊息範本

若要建立訊息範本,請傳送 POST 要求至 /page_id/messenger_lead_forms 端點,其中 page_id 是您的商家 Facebook 粉絲專頁編號。您的要求必須包含:

  • access_token
  • privacy_url
  • step_list 陣列,其中包含 messagereply_typestep_idstep_type
  • template_name
  • reminder_text

以下訊息範本包含您的 template_nameprivacy_url,以及 step_list,其中 step_id: 0 為歡迎訊息、step_id: 14 為問題、step_id: 5 為確認訊息、step_id: 6 為資格不符訊息。

訊息範本快速參考資料

潛在顧客訊息範本範例

採用方便閱讀的格式。將粗體、斜體值(例如 page_access_token)換成您的值。
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 名單型廣告表單範本清單,您可以傳送 GET 要求至 /page_id/messenger_lead_forms 端點。您也可以傳送 GET 要求至 /Your_messenger_lead_gen_template_id 端點,以取得特定範本的相關資訊。

廣告創意範例

若要為名單型廣告建立廣告創意,請傳送 POST 要求至 /act_ad_account_id/adcreatives 端點,其中 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

使用圖像之 Messenger 名單型廣告的廣告創意範例

採用方便閱讀的格式。將粗體、斜體值(例如 ad_account_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" }"
            }
          }
       }' 

使用影片之 Messenger 名單型廣告的廣告創意範例

採用方便閱讀的格式。將粗體、斜體值(例如 ad_account_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 對話的任何帳號管理中心帳號。您也可以加入其他目標條件,例如人口統計資料、地理資料、自訂廣告受眾或興趣。

必備條件

  • 請勿使用自訂廣告受眾 來排除用戶,使其無法收到贊助訊息
  • targeting.publisher_platforms 僅限 messenger
  • targeting.messenger_positions 僅限 sponsored_messages
  • targeting.device_platforms 必須同時包括 mobiledesktop
  • promoted_object 必須是您的商家 Facebook 粉絲專頁編號
  • 您必須指定按鈕的承載內容或網址
  • 您必須在對話中提供選項,以供用戶在桌上型電腦行動裝置上選擇不接收訊息或封鎖訊息。

限制

  • 僅支援使用 billing_event=IMPRESSIONSoptimization_goal=IMPRESSIONS 的 CPM。最低出價依國家/地區不同。瞭解詳情。
  • 僅支援包含按鈕的文字或圖像,或快速回覆。

    若要為贊助訊息建立廣告創意,您的要求應包含 object_id 參數(設為您的 Facebook 粉絲專頁編號)、object_type(設為 SHARE)、messenger_sponsored_message 物件(message.text 參數設為廣告的文字),以及包含下列參數的 message.attachment 物件:

    Messenger 贊助訊息的訊息附件快速參考資料

    圖像廣告創意要求範例

    採用方便閱讀的格式。將粗體、斜體值(例如 ad_account_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"
               "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 陣列。

    採用方便閱讀的格式。將粗體、斜體值(例如 page_access_token)換成您的值。
    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"
    }
    

    步驟 4:建立廣告

    若要建立廣告,您需要為廣告創意和廣告組合建立關聯。若要建立廣告,請傳送 POST 要求至 /act_ad_account_id/ads 端點,其中 ad_account_id 是 Meta 廣告帳號的編號。您的要求必須包含:

    • access_token
    • adset_id(來自步驟 2
    • creative_id(來自步驟 3
    • name
    • status

    廣告帳號廣告快速參考資料

    廣告創意廣告要求範例

    採用方便閱讀的格式。將粗體、斜體值(例如 ad_account_id)換成您的值。
    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"
    }
    

    步驟 5:發佈廣告

    確認您的廣告是否存在於廣告管理員 中。點擊右上角的「檢查並發佈」按鈕。選擇您的行銷活動、行銷活動的廣告組合以及廣告。

    您可以從廣告管理員或使用 API 來發佈廣告。若要使用 API 來發佈,請重複步驟 4,並將 status 參數設為 ACTIVE

    Meta 會審查您的廣告,而狀態會是 PENDING_REVIEW。通過審查後,狀態會是 ACTIVE,並且會投放您的廣告。

    進階 Messenger 發訊廣告元素

    您可以建立包含多個訊息元素的訊息,例如通話提示或多個範本。若要加入這些元素,您需要為 *_data.page_welcome_message 值設定物件陣列,而不是設定字串值。

    粉絲專頁歡迎訊息陣列快速參考資料

    加入通話提示

    若要將通話提示加入 Messenger 發訊廣告,您可以將 *_data.page_welcome_message 的值設為用來定義通話提示元素的物件陣列。將 landing_screen_type 參數設為 call_promptmedia_type 設為 texttext_format.message 物件的 text 設為您的歡迎訊息文字,並將 call_prompt_data.call_prompt_message 設為致電商家的提示。

    採用方便閱讀的格式。將粗體、斜體值(例如 page_access_token)換成您的值。
    ... 
          "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_access_token)換成您的值。
    ... 
          "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,請設定以在用戶點擊您的廣告時收到通知。