company logo

Help center

Go to Loyally.ai
Login
HomepageRoadmapFeature RequestBlogCreate an accountGet in touch
All collectionsMailings: Push, SMS, & EmailFacebook MessengerConnecting Facebook Messenger Bot to Loyally

Connecting Facebook Messenger Bot to Loyally

Set up your Facebook Messenger bot and connect it with Loyally to send automated messages, loyalty updates, and customer notifications through Messenger.

Integrating a Facebook Messenger Bot allows you to communicate directly with your customers through Messenger — sending automatic welcome messages, loyalty updates, or promotional reminders.

To connect Messenger with Loyally, you’ll first need to create and configure a bot on the Facebook Developer platform.

Follow these steps carefully to set it up.


🧭 What You’ll Need

Before you begin, make sure you have:

  • A Facebook Page for your business

  • A Facebook Developer Account

  • Admin access to your Loyally account

  • A server or endpoint (e.g., your Loyally webhook URL) for message callbacks


⚙ Step 1. Create a Facebook Page

Your Messenger bot must be connected to a Facebook Page.

  1. Go to https://www.facebook.com/pages/create.

  2. Click Create in the top-right corner.

  3. Select Page and follow the prompts to set it up (business name, category, description, profile picture, etc.).

💡 Tip: Use your business’s official branding so customers easily recognize your messages.


🧩 Step 2. Set Up a Facebook Developer Account

You’ll use the Facebook Developer portal to configure your Messenger bot.

  1. Visit https://developers.facebook.com.

  2. Click Get Started.

  3. Follow the setup prompts to create your Developer Account.

  4. Accept Facebook’s Developer Policies.


🧱 Step 3. Create a New App

  1. In your Facebook Developer Dashboard, click My Apps → Create App.

  2. Select Manage Business Integrations as the app type.

  3. Fill in the required details (App Name, Contact Email, Business Account).

  4. Click Create App ID.


💬 Step 4. Add Messenger to Your App

  1. Once your app is created, go to Add Product → Messenger → Set Up.

  2. Messenger will now appear in your app’s sidebar under Products.


🔑 Step 5. Generate a Page Access Token

This token allows your Messenger bot to send and receive messages on behalf of your Facebook Page.

  1. In your app dashboard, navigate to Messenger → Settings → Access Tokens.

  2. Under Access Tokens, select the Page you created earlier.

  3. Click Generate Token.

  4. Copy the generated token and store it securely — you’ll need it to connect your bot to Loyally.

warning icon
Important: Treat your Page Access Token like a password — anyone with this token can send messages from your Page.

🌐 Step 6. Set Up a Webhook

Webhooks allow Facebook to send message events (like customer messages or postbacks) to your server.

  1. In the Messenger settings, scroll down to Webhooks and click Set Up Webhooks.

  2. Provide your own callback URL – this is the endpoint on your server (or your Loyally integration endpoint) that will process incoming Messenger events.

  3. Select the subscription fields you want (for example, messages, messaging_postbacks).

  4. Click Verify and Save.

💡 Tip: Ask your developer or platform administrator for the exact callback URL and verify-token value required for your Loyally installation.


🧠 Step 7. Verify and Save the Webhook

Facebook will send a verification request to your callback URL.

  1. Implement the verification logic in your server to handle the request.

  2. Once verified, save the webhook configuration.


🔔 Step 8. Subscribe Your App to the Facebook Page

After setting up the webhook, you need to subscribe your app to the Facebook Page.

  1. In the Webhooks section, under Page Subscriptions, select the page and click Subscribe.

  2. ✅ Your app is now subscribed to receive message events from your Facebook Page.


🧪 Step 9. Test Your Messenger Bot

  1. Go to your Facebook Page.

  2. Click Message.

  3. Type a message (e.g., “Hi”) and send it to your page.

  4. Verify that your bot responds (you can test using a simple text reply from your server or webhook handler).


🚀 Step 10. Deploy Your Bot

Once you’ve confirmed your bot works as expected in test mode:

  1. Move your app to Live Mode in the Facebook Developer Dashboard.

⚠ Important: Facebook will only send events for live Pages when your app is in Live Mode and all permissions are approved.


🧩 Step 11. Connect Messenger Bot in Loyally

Once your Messenger bot is ready on the Facebook side, connect it to Loyally.

  1. Log in to your Loyally Dashboard.

  2. Go to Settings → Services → Connect Facebook Messenger.

  3. Paste your Page Access Token and Page ID.

  4. Save and verify the connection.

✅ Once connected, you can start using Messenger in Automations, Campaigns, and Notifications.


✅ Summary

You’ve successfully created and configured your Facebook Messenger Bot for Loyally.
Once connected, you can use Messenger to send automatic replies, loyalty updates, and promotional messages — keeping your customers engaged and informed directly in their favorite chat app.

Did this answer your question?
😞
😐
😁