Troubleshooting
Running into issues? Don't worry - most problems have simple fixes! Find your issue below and follow the solution.
Webhook Verification Failsโ
Error: "The callback URL or verify token couldn't be validated."
Possible Causes & Fixes:โ
| # | Cause | Fix |
|---|---|---|
| 1 | URL is not HTTPS | Install an SSL certificate on your server |
| 2 | Typo in callback URL | Copy-paste directly from the module settings |
| 3 | Typo in verify token | Copy-paste directly from the module settings |
| 4 | Server is blocking requests | Check your firewall / security plugins |
| 5 | .htaccess redirect issues | Make sure the URL doesn't redirect (no www โ non-www redirect issues) |
| 6 | Selected "User" instead of "Page" | Change the dropdown to "Page" in Facebook webhooks |
How to Debug:โ
- Open your browser and visit your webhook URL directly:
https://yourcrm.com/facebookleadsintegration/webhook?hub.mode=subscribe&hub.verify_token=YOUR_TOKEN&hub.challenge=test123 - If working correctly, you should see
test123displayed on the page - If you see an error page, the issue is on your server side
Still not working? Check your server's error logs at /path/to/your/crm/application/logs/
"Invalid Scopes" Error During Facebook Loginโ
Error: "Invalid Scopes: pages_manage_metadata"
Fix:โ
This means the module is requesting a deprecated permission. Make sure you're using the latest version of the module (v2.0.0+), which uses the correct permissions:
pages_show_listpages_read_engagementleads_retrievalpages_manage_adsads_management
Update your module to the latest version to fix this.
"Error Accessing App" / "App Not Active"โ
Error: When trying to connect with Facebook, you see "Error Accessing App" or "The app is not active."
Possible Causes & Fixes:โ
| # | Cause | Fix |
|---|---|---|
| 1 | Wrong App ID in module settings | Double-check the App ID matches your Meta App |
| 2 | App was deleted or disabled | Check your app at developers.facebook.com/apps |
| 3 | You're not an admin/developer of the app | Add yourself in App Roles โ Roles |
| 4 | App restrictions | Check App Settings โ Basic โ App Restrictions |
Test Lead Works but Real Leads Don't Arriveโ
The module's "Send Test Lead" button works, but real leads from Facebook don't appear.
Check These:โ
| # | Check | How |
|---|---|---|
| 1 | Is your Page subscribed? | Settings โ Connected Pages โ Must show "Monitoring" |
| 2 | Is the webhook verified? | Settings โ Connection Status โ Webhook must be green |
| 3 | Is "leadgen" subscribed? | Meta App โ Webhooks โ Page โ "leadgen" must be checked |
| 4 | Is the ad using the right Page? | Ads Manager โ Ad Set โ Make sure it uses the subscribed Page |
| 5 | Is the ad running? | Ads Manager โ Campaign status should be "Active" |
Test with Facebook's Tool:โ
Use the Lead Ads Testing Tool to send a real webhook test lead. If this works but actual ads don't, the issue is likely with your ad campaign setup.
500 Error on Module Pagesโ
Symptom: Module pages show a blank page or "500 Internal Server Error"
Fixes:โ
-
Check PHP error logs:
/path/to/your/crm/application/logs/log-YYYY-MM-DD.php -
Common causes:
- PHP version too old (need 7.4+)
- Missing PHP extensions (cURL, JSON)
- File permissions incorrect
- Module files corrupted during upload
-
Fix file permissions:
find /path/to/modules/facebookleadsintegration -type f -exec chmod 644 {} \;
find /path/to/modules/facebookleadsintegration -type d -exec chmod 755 {} \; -
Re-upload the module if files might be corrupted
Copy Button Not Workingโ
Symptom: Clicking the "Copy" button next to webhook URL or verify token does nothing.
Fix:โ
- Make sure your CRM is accessed via HTTPS - clipboard API requires a secure context
- Try manually selecting the text and pressing Ctrl+C
- Check browser console for JavaScript errors (F12 โ Console tab)
Leads Are Stuck in "Pending Retry"โ
Symptom: Sync History shows leads with "Pending" status that aren't being processed.
Fixes:โ
- Process manually: Go to Sync History โ Click "Process Retry Queue"
- Check cron: The retry queue processes automatically via Perfex CRM's cron job
- Make sure your cron job is running: Setup โ Settings โ Cron Job
- The cron URL should be called every 5 minutes
- Check the error message in Sync History for why the lead failed initially
Access Token Expiredโ
Symptom: Connection test fails with "Token expired" or leads stop arriving.
Fix:โ
The module exchanges short-lived tokens for long-lived tokens (valid for ~60 days). To refresh:
- Go to Meta Leads โ Settings
- Scroll to Connected Pages
- Click "Connect with Facebook" again
- Log in and grant permissions
- The token is automatically refreshed
Set a reminder to reconnect every 50 days to keep the token fresh!
Fields Not Mapping Correctlyโ
Symptom: Lead data appears in the wrong fields or is missing.
Debug Steps:โ
- Go to Sync History โ Click on a lead entry to see the raw data
- Check what field names Facebook is sending
- Go to Field Mapping โ Make sure the Facebook field name matches
- Remember: Standard fields (email, full_name, phone_number) map automatically
Common Field Name Issues:โ
| What You Expect | What Facebook Sends | Solution |
|---|---|---|
name | full_name | Already auto-mapped |
phone | phone_number | Already auto-mapped |
company | company_name | Already auto-mapped |
budget | custom_question_1 | Create a custom mapping |
Module Doesn't Appear After Installationโ
Fixes:โ
- Check file location: Module folder must be at
modules/facebookleadsintegration/ - Check file name: Main file must be
facebookleadsintegration.php(all lowercase) - Activate the module: Go to Setup โ Modules โ Click Activate
- Check permissions: Files should be readable by the web server (644 for files, 755 for directories)
Server-Specific Issuesโ
Cloudflare Usersโ
If using Cloudflare, whitelist Facebook's webhook IPs:
- Go to Cloudflare โ WAF (Web Application Firewall)
- Create a rule to Allow requests from Facebook
- Or add these to your firewall whitelist:
- Facebook's webhook IPs can be found at:
https://developers.facebook.com/docs/sharing/webmasters/getting-started/webhooks/
- Facebook's webhook IPs can be found at:
Nginx Usersโ
Make sure your Nginx config allows POST requests to the webhook URL and doesn't block Facebook's User-Agent.
Shared Hostingโ
Most shared hosting works fine. If you have issues:
- Check if
allow_url_fopenis enabled in PHP - Check if
cURLextension is installed - Check if your host blocks incoming webhooks (some security-focused hosts do)
Still Need Help?โ
If none of the above fixes your issue:
- Check the Perfex CRM error logs
- Check the module's Sync History for error messages
- Take a screenshot of any error messages
- Contact us at [email protected] with:
- Your Perfex CRM version
- PHP version
- The error message
- Steps to reproduce the issue
Check the FAQ for more answers FAQ