The Facebook Messenger channel allows your AI agent to receive and respond to messages sent to your Facebook Pages. Customers can message your Page, and your agent responds using your knowledge base—just like the chat widget but through Messenger.
How It Works
- Message arrives via Facebook Messenger to your connected Page
- Agent processes the message using your knowledge base
- Response sent back to the customer through Messenger
- Conversation tracked in your dashboard
All Messenger conversations appear alongside widget chats and emails, so you have a unified view of all customer interactions.
Prerequisites
Before you can use the Messenger channel, you’ll need:
- An Ansa account on Growth plan or higher
- A Facebook Page (business or personal)
- A Facebook Developer account
- A Facebook App with Messenger permissions
Facebook Developer Setup
Step 1: Create a Facebook App
- Go to Facebook Developers
- Click My Apps → Create App
- Select Business as the app type
- Enter your app name and contact email
- Click Create App
Step 2: Add Messenger Product
- In your app dashboard, find Add Products to Your App
- Click Set Up on the Messenger card
- Accept the Messenger Platform terms
Your app needs these permissions:
| Permission | Purpose |
|---|
pages_messaging | Send and receive messages |
pages_manage_metadata | Access Page metadata |
pages_show_list | List your Pages during OAuth |
pages_read_engagement | Read Page engagement data |
To request these permissions:
- Go to App Review → Permissions and Features
- Request each permission
- For live mode, submit for App Review
For testing, you can use Development Mode which allows your app to work with Pages you manage without App Review.
Connecting Your Pages
Step 1: Enable Messenger Channel
- Go to Channels → Messenger in your Ansa dashboard
- Click Connect Pages
- Log in with Facebook and authorize the app
- Select which Pages to connect (multi-select supported)
- Click Connect
After connecting your Pages, you need to set up the webhook in Facebook:
- Click the External Link icon next to a connected Page
- Copy the Callback URL and Verify Token
- In your Facebook App, go to Messenger → Settings
- Under Webhooks, click Add Callback URL
- Paste the Callback URL and Verify Token
- Click Verify and Save
- Subscribe to these webhook events:
messages
messaging_postbacks
Step 3: Subscribe Your Page
- In Facebook App → Messenger → Settings
- Under Webhooks, find your Page
- Click Add Subscriptions
- Select
messages and messaging_postbacks
- Click Save
Configuration Options
Basic Settings
| Setting | Description |
|---|
| Enabled | Master toggle for the Messenger channel |
AI Confidence Settings
| Setting | Description |
|---|
| Confidence Threshold | Minimum confidence required (0-100%) |
| Low Confidence Action | What to do when confidence is low |
| Forward Email | Email address for forwarded messages |
Low Confidence Actions
| Action | Description |
|---|
| Do Nothing | Send the AI response regardless |
| Escalate | Create a ticket for human review |
| Forward | Forward to a specified email |
Multiple Pages
You can connect multiple Facebook Pages to a single agent. This is useful if you:
- Manage multiple brands under one account
- Have regional Pages for different markets
- Run separate Pages for different products
Each Page gets its own webhook verify token for security.
Testing
Send a Test Message
- Go to your Facebook Page
- Click Send Message (or visit
m.me/your-page-id)
- Send a test message
- Check your Ansa dashboard for the conversation
Troubleshooting
No response received:
- Check that the Messenger channel is enabled
- Verify the webhook is correctly configured
- Check that your Page is subscribed to message events
- Ensure your agent has AI enabled
Webhook verification failing:
- Make sure you’re using the correct verify token from Ansa
- Check that the callback URL is exactly as shown
- Ensure your Facebook App is in Development or Live mode
Messages not appearing in dashboard:
- Verify the Page is connected in Ansa
- Check that the Page’s webhook subscription is active
- Look for errors in the webhook delivery logs
Security
Signature Verification
All incoming webhooks from Facebook are verified using HMAC-SHA256 signatures. This ensures that messages are genuinely from Facebook and haven’t been tampered with.
Page Access Tokens
When you connect a Page, Ansa stores a long-lived Page Access Token. This token:
- Is automatically refreshed
- Is encrypted at rest
- Is only used to send messages on behalf of your Page
Data Handling
- Messages are processed in real-time
- Conversation history is stored in your Ansa account
- You can delete conversations at any time
- Ansa doesn’t share your data with third parties
Limitations
- Text only: Currently only text messages are supported. Attachments, images, and rich media are not processed.
- No quick replies: Quick reply buttons are not yet supported.
- 24-hour window: Facebook’s 24-hour messaging window applies. Messages sent outside this window require a message tag.
Pricing
The Messenger channel is included in Growth, Pro, and Enterprise plans at no additional cost. Message usage counts toward your monthly message quota.