algos crm.
CRM Documentation
The same product docs available in the dashboard—guides for setup, architecture, modules, and day-to-day use.
Channels · Facebook Lead Ads
Facebook Lead Ads
Fully supported Meta Lead Ads → CRM lead ingestion.
Prerequisites
- Meta app with Lead Ads / webhooks capability
- Facebook Page + lead form
- Page access token
META_APP_SECRETin CRM.env(same Meta app)
Meta links:
- Apps: https://developers.facebook.com/apps
- App Secret: App settings → Basic
- Webhooks: app dashboard → Webhooks / Page subscriptions for
leadgen
Connect in CRM
- Set
META_APP_SECRETandphp artisan config:clear - Channels → Connect channel → Facebook Lead Ads
- Enter:
- Display name
- Facebook Page ID (
external_page_id) - Page access token
- Connect, then copy Webhook URL + Verify token
Meta webhook setup
- Callback URL: public HTTPS URL to
/webhooks/channels/{uuid}
(use ngrok for local) - Verify token: from CRM connection page
- Subscribe to leadgen for the Page
- CRM handles
GEThub.challenge verification automatically for this provider
Processing behavior
- Validate
X-Hub-Signature-256withMETA_APP_SECRET(fallback: connection webhook secret) - Parse
leadgenchanges; skip other pages if Page ID is set on the connection - Fetch lead field data from Graph API with the page token
- Create/update CRM lead (source
facebook) +lead_channel_meta(campaign/ad/form/page ids) - Idempotency key:
facebook_leadgen_{leadgen_id}
Test connection
Calls Graph GET /{page-id}?fields=id,name with the stored token.
Queue
Inbound POSTs are queued on channels. Keep a worker running.
Security
- Rotate App Secret / page tokens if exposed
- Prefer short-lived tokens only for demos; use long-lived / system user tokens in production
Related
- Channels overview
- WhatsApp Cloud API (shares Meta app secret pattern)