Facebook lead ads plugin enables synchronization of Facebook Lead Ads as leads into Mautic.Installation:
- Require the FB ads library in the Mautic root directory composer require facebook/php-ads-sdk:2.9.* The library has been tested on 5.6 to also work so if you get requirements errors try: composer require --ignore-platform-reqs facebook/php-ads-sdk:2.9.*
- Create a new Facebook App or use an existing one: https://developers.facebook.com/apps/
- Visit the app Dashboard page and store the app_id and app_key for later use.
- Add the Marketing API Product.
- Visit the Marketing API -> Tools page in your app and check the scopes and hit Get Token. Store this access_token for later use.
- Go into your Facebook Ads account management and get your ad account id.
- Enable the plugin and enter your app_id, app_secret, Marketing API access_token, ad account id and choose a verify token.
- Authenticate the app using oAuth.
- In the plugin settings map the fields to your contact lead fields.
- Enable the webhooks Product in your Facebook App.
- Go to the webhooks product in your Facebook APP and add your subscriber to the 'page' event: URL: $YOURHOST/plugin/fbadsleadads/leadform_subscriber verify_token: Token you choose in step 7.
- In your Facebook App Review add the manage_pages scope for review.