Drupal is a registered trademark of Dries Buytaert

meta_conversions_api

173 sites No security coverage
View on drupal.org

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

  1. Use composer to require the module and make sure facebook/php-business-sdk has also been installed.
  2. 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.

Activity

Total releases
2
First release
Oct 2025
Latest release
5 months ago
Release cadence
1 day
Stability
50% stable

Releases

Version Type Release date
1.1.x-dev Dev Oct 4, 2025
1.1.0 Stable Oct 3, 2025