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.
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
Your Messenger bot must be connected to a Facebook Page.
Click Create in the top-right corner.
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.
You’ll use the Facebook Developer portal to configure your Messenger bot.
Click Get Started.
Follow the setup prompts to create your Developer Account.
Accept Facebook’s Developer Policies.
In your Facebook Developer Dashboard, click My Apps → Create App.
Select Manage Business Integrations as the app type.
Fill in the required details (App Name, Contact Email, Business Account).
Click Create App ID.
Once your app is created, go to Add Product → Messenger → Set Up.
Messenger will now appear in your app’s sidebar under Products.
This token allows your Messenger bot to send and receive messages on behalf of your Facebook Page.
In your app dashboard, navigate to Messenger → Settings → Access Tokens.
Under Access Tokens, select the Page you created earlier.
Click Generate Token.
Copy the generated token and store it securely — you’ll need it to connect your bot to Loyally.
Webhooks allow Facebook to send message events (like customer messages or postbacks) to your server.
In the Messenger settings, scroll down to Webhooks and click Set Up Webhooks.
Provide your own callback URL – this is the endpoint on your server (or your Loyally integration endpoint) that will process incoming Messenger events.
Select the subscription fields you want (for example, messages
, messaging_postbacks
).
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.
Facebook will send a verification request to your callback URL.
Implement the verification logic in your server to handle the request.
Once verified, save the webhook configuration.
After setting up the webhook, you need to subscribe your app to the Facebook Page.
In the Webhooks section, under Page Subscriptions, select the page and click Subscribe.
Your app is now subscribed to receive message events from your Facebook Page.
Go to your Facebook Page.
Click Message.
Type a message (e.g., “Hi”) and send it to your page.
Verify that your bot responds (you can test using a simple text reply from your server or webhook handler).
Once you’ve confirmed your bot works as expected in test mode:
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.
Once your Messenger bot is ready on the Facebook side, connect it to Loyally.
Log in to your Loyally Dashboard.
Go to Settings → Services → Connect Facebook Messenger.
Paste your Page Access Token and Page ID.
Save and verify the connection.
Once connected, you can start using Messenger in Automations, Campaigns, and Notifications.
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.