Meta Business Integration (Instagram, Facebook, Messenger)
Reward your community for engaging with your brand on Instagram, Facebook, and Messenger. Track mentions, comments, likes, shares, and messages, and reward users with LTZ tokens automatically.
Overview
The Meta Loyalty Integration uses Meta's Business API and webhooks to monitor engagement across Instagram, Facebook Pages, and Messenger. Events are processed in real-time and trigger rewards through the Loyalteez platform.
| Feature | Description |
|---|---|
| Real-time | Webhook-based event processing (no polling needed) |
| Multi-platform | Supports Instagram, Facebook Pages, and Messenger |
| Automatic | Events processed automatically via webhooks |
| Partner Portal Integration | Credentials configured in Partner Portal (BYOK) |
| Configurable | Set reward amounts and limits in Partner Portal |
Supported Event Types
Instagram Events
| Event Type | Description | Points (Default) | Detection Method |
|---|---|---|---|
instagram_mention | User mentions @YourBrand | 50 | Webhook: mentions |
instagram_comment | User comments on your post | 40 | Webhook: comments |
instagram_tagged_post | User tags your brand in a post | 75 | Webhook: tagged_media |
instagram_story_mention | User mentions your brand in a story | 60 | Webhook: story_mentions |
Facebook Events
| Event Type | Description | Points (Default) | Detection Method |
|---|---|---|---|
facebook_page_like | User likes your Facebook page | 50 | Webhook: feed |
facebook_comment | User comments on your post | 40 | Webhook: feed |
facebook_share | User shares your post | 100 | Webhook: feed |
Messenger Events
| Event Type | Description | Points (Default) | Detection Method |
|---|---|---|---|
messenger_message | User sends a message to your brand | 25 | Webhook: messages |
Prerequisites
Before setting up the Meta integration, ensure you have:
- Meta Business Account - Required for Instagram Business features
- Instagram Business or Creator Account - Must be linked to a Facebook Page
- Facebook Page - Required for Instagram Business and Messenger
- Meta Developer App - Create at developers.facebook.com
- Webhooks Product Enabled - Enable in your Meta Developer App
- Required Permissions:
instagram_basicinstagram_manage_commentspages_read_engagementpages_manage_metadatapages_messaging(for Messenger)
Quick Start
1. Create Meta Developer App
- Go to Meta for Developers
- Click Create App
- Select Business as the app type
- Fill in app details and create the app
2. Configure App Settings
- In your app dashboard, go to Settings → Basic
- Note your App ID and App Secret
- Add Webhooks product to your app
- Configure Valid OAuth Redirect URIs if needed
3. Generate Long-Lived Access Token
- Go to Tools → Graph API Explorer
- Select your app and Facebook Page
- Generate a User Access Token with required permissions
- Exchange for a Long-Lived Page Access Token (60+ days)
- Use:
GET /oauth/access_token?grant_type=fb_exchange_token&client_id={app-id}&client_secret={app-secret}&fb_exchange_token={short-lived-token}
- Use:
caution
Store your App Secret and Access Token securely. Never commit them to git!
4. Configure in Partner Portal
- Log in to Partner Portal
- Navigate to Settings → Profile
- Expand the Meta Business authentication method section
- Enter:
- Instagram Username (without @)
- Facebook Page ID (numeric, found in Page Settings → About)
- Meta App ID
- Meta App Secret
- Meta Access Token (long-lived Page Access Token)
- Click Test Connection to verify credentials
- Click Save Profile to auto-deploy the integration
info
The integration is automatically deployed when you save your profile with valid credentials. No manual deployment needed!
Webhook Configuration
After saving your credentials, the deployment service will:
- Configure your brand in the Meta loyalty router
- Provide a webhook URL:
https://meta-deployment-service.taylor-cox1199.workers.dev/api/meta/webhook - You'll need to subscribe to webhooks in Meta Developer Portal
Subscribe to Webhooks
- Go to Meta Developer Portal → Your App → Webhooks
- Click Add Callback URL
- Enter:
https://meta-deployment-service.taylor-cox1199.workers.dev/api/meta/webhook - Set Verify Token (contact Loyalteez support for the token)
- Subscribe to:
- Instagram:
mentions,comments,story_mentions - Page:
feed,messages
- Instagram:
- Click Verify and Save
Event Processing Flow
Configuration Reference
Required Credentials
| Field | Description | Where to Find |
|---|---|---|
| Instagram Username | Your Instagram Business/Creator username | Instagram profile |
| Facebook Page ID | Numeric ID of your Facebook Page | Page Settings → About → Page ID |
| Meta App ID | Your Developer App ID | App Settings → Basic |
| Meta App Secret | Your Developer App Secret | App Settings → Basic |
| Meta Access Token | Long-lived Page Access Token | Graph API Explorer → Exchange Token |
Webhook Subscriptions
| Object | Fields | Purpose |
|---|---|---|
instagram | mentions, comments, story_mentions | Instagram engagement tracking |
page | feed, messages | Facebook Page and Messenger events |
Troubleshooting
Webhook Not Receiving Events
- Verify webhook subscription in Meta Developer Portal
- Check webhook status in Partner Portal → Settings
- Verify access token has required permissions
- Check webhook logs in Meta Developer Portal → Webhooks → Recent Requests
Events Not Triggering Rewards
- Verify event types are enabled in Automation Settings
- Check reward limits and cooldown periods
- Review event logs in Partner Portal → Analytics
- Ensure user has valid email (if required by event type)
Invalid Credentials Error
- Regenerate access token if expired
- Verify App ID and Secret are correct
- Check token permissions include all required scopes
- Ensure Instagram account is linked to Facebook Page
API Reference
Deployment Service Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/meta/deploy | POST | Configure brand integration |
/api/meta/status | GET | Check deployment status |
/api/meta/test | POST | Test credentials |
/api/meta/webhook | GET/POST | Webhook verification and receiver |
Webhook Event Format
{
"object": "instagram",
"entry": [{
"id": "instagram_business_account_id",
"time": 1234567890,
"changes": [{
"field": "mentions",
"value": {
"media_id": "123456789",
"comment_id": "987654321",
"from": {
"id": "user_id",
"username": "username"
}
}
}]
}]
}
Best Practices
- Use Long-Lived Tokens - Exchange short-lived tokens for 60+ day tokens
- Monitor Rate Limits - Meta API has rate limits; webhooks help avoid polling
- Test in Development - Use Meta's Test Users feature for testing
- Set Appropriate Rewards - Balance engagement value with token economics
- Monitor Webhook Health - Check webhook status regularly in Partner Portal
Support
For issues or questions:
- Documentation: docs.loyalteez.app
- Support Email: [email protected]
- Discord: Join our community