All Collections
Automation
Program builder
Program nodes
Program messaging channel: Allow contacts to opt into Facebook Messenger
Program messaging channel: Allow contacts to opt into Facebook Messenger

Let your contacts opt into receiving Messenger messages.

Henry Huish avatar
Written by Henry Huish
Updated over a week ago

Before your contacts can receive messages from you through Messenger, they must opt in by clicking the Facebook opt-in button.

Send_to_Messenger_button.png

You can display this opt-in button on either a landing page or one of the pages on your website.

After your contacts opt-in, they are given a value for their FBOPTIN_XXX contact data field. This value is confirmation of your contacts' opt-in, and without it, they can't be sent messages from you through Facebook Messenger.


Before you start

Things you need to know:

  • You can display this opt-in button on either a Dotdigital landing page or one of the pages on your website.

  • After your contacts opt in, they are given a value for their FBOPTIN_XXX contact data field. This value is confirmation of your contacts' opt-in and without it, they can't be sent messages from you through Messenger.


Display the Facebook opt-in button on a landing page

Don't have Surveys, pages, and forms?

If Surveys, pages, and forms aren't active on your account, contact us to discuss activating this feature or display the Facebook opt-in button on your own website.

There are two steps in the process:

1. Insert the Facebook opt-in code in your page

  1. Go to Connect > Digital marketing channels, and select Messenger.

  2. Select a Messenger profile.

  3. Copy the Facebook opt-in code from the Messenger profile.
    Learn more in Program messaging channel: Messenger.

  4. On your landing page, select a text building block and then select the Edit HTML icon


  5. Remove any existing code from the block, and paste the <div> element of the Facebook opt-in code into the block.

    Top Tip

    By default, the button is aligned with the left of the page. To align your opt-in button with the centre of the landing page, replace the code in the block with the following:

    <div style="text-align: center;"><div style="display: inline-block;" id="divFBMessenger"     class="fb-send-to-messenger" messenger_app_id=""     page_id="" data-ref="" color="blue" size="large"></div></div>


  6. Expand the UTILITIES drop-down menu and select Add tracking code.

  7. Select Other.

  8. Paste the <script> element of the Facebook opt-in code into the Other tracking code field.

  9. For Tracking code position, select Bottom of the <body>, and select APPLY.

  10. Publish your landing page.

2. Add a landing page link to an email campaign

Your Facebook opt-in button is displayed on your landing page only if the URL in the landing page link contains an email address. If that email address is not in one of your lists, the email address is not opted in to Messenger.

  1. Create a new email campaign or edit an existing one.

  2. In EasyEditor, drag and drop a button into your email campaign.

  3. Select Add a link, and select Link to a page to add a link to your landing page.

  4. Select INSERT and make a note the numerical ID in the button URL.

  5. Expand the UTILITIES drop-down menu and select Edit source.

  6. Select inside the code block, then use CTRL + F (or Cmd + F on a Mac) to bring up the search field, and search for the numerical ID from the button URL.

  7. Add the following query to the end of the button URL: ?email=@EMAIL@. The URL appears twice; make sure you add the query string to both occurrences.

    The @EMAIL@ placeholder is replaced with a contact's email address when you send the campaign.

  8. Select SAVE.

  9. Finish designing your campaign, then send it to your desired contacts.


Display the Facebook opt-in button on your own website

To display the Facebook opt-in button to contact’s through your own website:


1. Insert the Facebook opt-in code in the source code of your website

  1. Go to Connect > Digital marketing channels, and select Messenger.

  2. Select a Messenger profile.

  3. Copy the Facebook opt-in code from the Messenger profile.

    To learn more, check out the article Program messaging channel: Facebook Messenger.

  4. Paste this code into the HTML of a page on your website and make a note of the URL for this page.

    You might need your web developers to help you with this.

2. Add your website's link to an email campaign

Your Facebook opt-in button is displayed on a page of your website only if the URL in your website's link contains an email address. If that email address is not in one of your lists, the email address is not opted into Facebook Messenger.

  1. Create a new email campaign or edit an existing one.

  2. In EasyEditor, drag and drop a button into your email campaign

  3. Select Add a link, and select Hyperlink.

  4. Add the following query to the end of the link URL: ?email=@EMAIL@.
    The @EMAIL@ placeholder is replaced with a contact's email address when you send the campaign.

  5. Finish designing your campaign, then send it to your desired contacts.

Did this answer your question?