π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:
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=test123If working correctly, you should see
test123displayed on the pageIf 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:
1οΈβ£
Wrong App ID in module settings
Double-check the App ID matches your Meta App
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:
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:
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:
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:
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/
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 PHPCheck if
cURLextension is installedCheck 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 support@themesic.com with:
Your Perfex CRM version
PHP version
The error message
Steps to reproduce the issue
Check the FAQ for more answers π FAQ
Last updated