News for Developers

Back to News

Click-to-Messenger Ads Quickstart

Click-to-Messenger ads are the best way to get people to start chatting with your Messenger bot. These ads allow you to directly start a thread with your Facebook Page when the ad is clicked.

How to create Click-to-Messenger Ads

Step 1: Create a campaign with the messages objective.

There are other objectives that are also supported, such as link_clicks and conversion, but setting the objective to messages optimizes ad delivery to people more likely to respond to your business in Messenger.

curl \
  -F 'name=My campaign' \
  -F 'objective=MESSAGES' \
  -F 'status=PAUSED' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/campaigns

The campaign ID is returned for the campaign you just created in the response body. Save this campaign ID to create the ad set. Learn more about campaigns

Step 2: Create an ad set for your campaign.

This is where you define the targeting, optimization and budgets for your campaign. Click-to-Messenger ads live on the desktop, mobile news feed and Messenger home placements. You don't need to specify any of the placements when you're creating this ad set; it automatically defaults to Automatic placements, which means that your ads are shown to your audience in the places that they're likely to perform best. Learn more about ad sets.

Best practice - Set auto_bid to true to let Facebook automatically optimize for the best bid amount for your business. Set the optimization_goal to REPLIES to optimize for the number of people that will interact with your bot. There are various optimization_goal and billing_event combinations allowed. See all permutations here.

curl \
    -F 'name=My Ad Set' \
    -F 'optimization_goal=REPLIES' \
    -F 'billing_event=IMPRESSIONS' \
    -F 'is_autobid=true' \
    -F 'daily_budget=100000' \
    -F 'campaign_id=<CAMPAIGN_ID>' \
    -F 'targeting={ 
      "geo_locations": {"countries":["US"]}, 
      "user_adclusters": [ 
       {"id":6002714885172,"name":"Cooking"}, 
        {"id":6002714898572,"name":"Small Business Owners"} 
      ]
    }' \
    -F 'status=ACTIVE' \
    -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adsets

Step 3: Create an ad creative.

  • Click-to-Messenger ad creative formats must be single image, single video, carousel or slideshow.
  • You must set the app_destination to MESSENGER.
  • When people click your ad, you want to send them a welcome message to introduce them to your bot; here are some options to do this:
    • Provide a default welcome message as a string in page_welcome_message.
    • Provide a default template message, or a series of up to 5 template messages, as Message Template JSON Blobs.

Example - Single image ad creative with a default template message including 2 buttons and 2 quick replies

curl \
-F 'name=My image creative for Messenger' \
-F 'object_story_spec={ 
  "link_data": { 
    "call_to_action": {"type":"LEARN_MORE","value":{"app_destination":"MESSENGER"}}, 
    "image_hash": "<IMAGE_HASH>", 
    "link": "<URL>", 
    "message": "Sample Ad Message",
    "page_welcome_message": {
      "message": {
        "attachment": {
          "type":"template",
          "payload": {
            "template_type":"generic",
            "elements": [
              {
                "title":"Enter a title to accompany your image",
                "image_url":"https://image.ibb.co/bz5t6Q/placeholder.png",
                "subtitle":"Optional: Enter a subtitle to provide more information",
                "buttons": [
                  {
                    "type":"web_url",
                    "url":"http://www.example.com/",
                    "title":"ViewWebsite"
                  },
                  {
                    "type":"postback",
                    "title":"Start Chatting",
                    "payload":"USER_DEFINED_PAYLOAD"
                  }
                ]
              }
            ]
          }
        },
        "quick_replies": [
          {
            "content_type":"text",
            "title":"Hello",
            "payload":"reply1"
          },
          {
            "content_type":"text",
            "title":"Learn More",
            "payload":"reply2"
          }
        ]
      }
    }
  },
  "page_id": "<PAGE_ID>" 
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adcreatives

Learn more about different ad creatives and message templates; see Ad Creative, Reference and Message Templates, Reference.

Best practice - Communicate the value proposition of your business’s Messenger experience in the ad unit itself (for example, promotions, personalized product advice, fun experience, and so on). Use text (for example, “Send us a message”), images and Call To Action buttons to prime users for a conversation with your business.

Step 4: Associate your creative to the ad set.

curl \
  -F 'name=My Ad' \
  -F 'adset_id=<AD_SET_ID>' \
  -F 'creative={"creative_id":"<CREATIVE_ID>"}' \
  -F 'status=PAUSED' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/ads

Need more help?