Meta Conversions API
This module integrates your Drupal site with the Meta Conversions API. It allows you to send events like PageViews to Meta, with options to enable/disable specific events and integrate with consent management systems.
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.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.