Step-by-Step Guide to Create a Facebook API Connection for Use with DigifyCRM (Facebook Leads Synchronization Module)
To use the Facebook Leads Synchronization Module in DigifyCRM, you need to create a Facebook API connection. This requires setting up a Facebook App via the Facebook Developer platform and configuring it to sync leads. Below are the detailed steps to create the API connection.
Step 1: Create a Facebook Developer Account
1. Go to Facebook Developer Portal.
2. Login with your Facebook account (must have admin rights for the Facebook pages you plan to sync).
3. If this is your first time, you'll need to create a Developer Account:
o Click Get Started.
o Follow the instructions to complete your developer profile.
Step 2: Create a New Facebook App
1. Click on My Apps from the top-right corner of the developer dashboard.
2. Click the Create App button.
3. Select App Type:
o Choose Business as the app type.
4. Enter Details:
o App Name: Enter a name for your app (e.g., DigifyCRM Leads Sync).
o Contact Email: Add a valid email for notifications.
o Click Create App ID and confirm with your Facebook password if prompted.
Step 3: Add Products to the App
After creating the app, you'll need to add the necessary products that will allow your app to manage Facebook leads:
1. Facebook Login:
o Go to the Dashboard of your new app.
o Scroll down to the Add a Product section.
o Click on Set Up next to Facebook Login.
o Choose Web as the platform.
o Enter your website URL (where DigifyCRM is installed) in the Site URL field.
2. Webhooks:
o In the Dashboard, scroll down and click Add a Product again.
o Select Webhooks and click Set Up.
o This will allow Facebook to send real-time updates (such as lead data) to your app.
Step 4: Configure Facebook Login
1. Go to the Facebook Login section from the side menu.
2. Settings > Basic:
o Add Valid OAuth Redirect URIs. This is the URL that Facebook will redirect to after the user logs in and grants permissions. It should be similar to:
arduino
Copy code
https://yourdomain.com/digifycrm/facebook_oauth_redirect
o Save changes.
3. App Review:
o You will need to Request Permissions to access leads data.
o Go to App Review > Permissions and Features.
o Search for and Request the following permissions:
§ ads_management
§ pages_manage_ads
§ pages_manage_metadata
§ pages_read_engagement
§ leads_retrieval
o Each permission request will need to be justified with details about how your app will use them. You will also need to submit a screencast demonstrating the functionality.
Step 5: Add Webhook Subscriptions
To enable your app to receive lead data in real-time, you'll need to set up webhooks:
1. Go to the Webhooks section from the side menu.
2. Set Up a Webhook:
o Select Page as the object to subscribe to.
o Enter the Callback URL where DigifyCRM will receive the leads.
Copy code
Example
https://YOURID.crm.digifyseo.com/facebookleadsintegration/webhook (Can be found in Setting > Facebook Leads Integration)
Enter a Verify Token (a random string you will use to validate the webhook).
o Select leads as the field to subscribe to, which will allow Facebook to send lead data to your app.
Step 6: Generate Access Tokens
1. Go to the Facebook Login > Access Tokens section in your app.
2. Click Generate Access Token to get a token for the admin profile.
3. Use this token to connect your Facebook account with DigifyCRM.
Step 7: Submit App for Review (Required for Live Use)
Before you can start syncing leads from your live ads, Facebook requires your app to be reviewed:
1. Go to App Review > Permissions and Features.
2. Make sure to submit the app for review after requesting all necessary permissions.
3. Once the app is approved, you can start using it for live lead synchronization.
Step 8: Connect DigifyCRM to Your Facebook App
1. In DigifyCRM, navigate to Setup > Facebook Leads Integration.
2. Click Connect to Facebook and log in using your Facebook account.
3. Allow necessary permissions for the app to access your Facebook Pages and Forms.
4. Select the Facebook Pages and Forms you wish to sync with DigifyCRM.
Step 9: Test the Connection
1. Create a test lead by submitting a Facebook lead form from one of your active Facebook ad campaigns.
2. Ensure that the lead is captured in real-time in your DigifyCRM’s Leads section.
3. Check that all relevant fields (name, email, phone, etc.) are being synced properly.