A secure webhook that processes Facebook Lead Ads in real-time — stores every lead to your database and fires an email notification the moment a prospect submits your form.
The entire pipeline runs automatically — no manual steps required.
Built on Laravel — production-ready, secure, and extensible.
Handles Meta's GET verification challenge and POST lead events. Responds with 200 OK instantly while processing in the background.
Route leads from different Facebook forms to different email addresses. Add entries to the facebook_forms table per form ID.
Every incoming POST is verified against your App Secret using HMAC-SHA256. Invalid requests are rejected with 401 Unauthorized.
All leads — including raw payload, field data, form ID, campaign ID, and ad ID — are persisted locally in SQLite automatically.
A beautifully formatted email with all lead fields is sent the moment data is fetched from the Graph API. Subject: New Facebook Lead Received.
Every webhook call, API fetch, email dispatch, and error is logged via Laravel's logging system for easy debugging and audit.
Configure your .env file and register the webhook with Meta.
Open .env and fill in: FACEBOOK_VERIFY_TOKEN (any secret string you choose), FACEBOOK_APP_SECRET (from Meta App Dashboard), FACEBOOK_PAGE_ACCESS_TOKEN (from Graph API Explorer with leads_retrieval permission), and LEAD_NOTIFICATION_EMAIL.
Run php artisan migrate to create the leads and facebook_forms tables in SQLite.
In your Meta App → Webhooks → Add Webhook. Set the Callback URL to https://leads.bizmo-tech.com/webhook/facebook and the Verify Token to whatever you set in FACEBOOK_VERIFY_TOKEN. Subscribe to Page → leadgen.
Insert a row into the facebook_forms table for each Facebook form ID with a specific notification_email. Leads from unmapped forms fall back to LEAD_NOTIFICATION_EMAIL.
In Meta for Developers → your Page → Lead Ads Testing Tool, submit a test lead. Check storage/logs/laravel.log and your inbox to verify delivery.