meta_conversions_api
173 sites
No security coverage
Allows integrating with Meta Conversions API.
Features
- Out of the box comes with a PageView event.
- Allows enabling/disabling each event and declaring new events.
- Uses hooks to control event triggering, for integration with cookie banners.
Post-Installation
- Use composer to require the module and make sure facebook/php-business-sdk has also been installed.
- Go to the settings page and enter the Access Token and Pixel ID from Facebook.
Additional Requirements
Uses Facebook's PHP Business SDK.
Usage
Consent
To require consent, you must implement hook_meta_conversions_api_allowed() (for example, checking a cookie).
It is also recommended to override the Drupal.meta_conversions_api.allowedCallback function in your own JavaScript library, as this will avoid unnecessarily making requests to the server.
Adding events
You can implement hook_meta_conversions_api_event_names() to add your own events. This is only necessary if you intend on making it possible to disable the event.
You can rename existing events with hook_meta_conversions_api_event_names_alter().
You can send your own events with the sendRequest() method of the MetaClient service.