Advanced Mautic Integration
Connects a Drupal site to a Mautic instance in both directions: the Mautic tracking script on the pages you choose, with the events and contact data you choose, and the Mautic REST API available to your own code, with an optional synchronization of Drupal users to Mautic contacts.
JavaScript tracking
- Loading mtc.js from your Mautic instance, through the module's own library rather than an inline script, so it works under a Content Security Policy.
- Tracking page views, one per page load.
- Tracking outbound links, a
pageviewevent for external links. - Tracking mail and phone links, a
pageviewevent formailto:andtel:links. - Tracking downloads, a
pageviewevent for links to the file extensions you list. - Default parameters sent with every event, with tokens: for example the current user's e-mail, to identify anonymous contacts in Mautic. The module takes care of the cache dependencies the tokens bring in.
- Where the script appears, chosen with the same condition plugins as block placement: pages, content types, roles, languages. Track only the pages that matter.
- Your own events, through
Drupal.mt_send()from any JavaScript on the site.
API connection
The module wraps the Mautic API library, which Composer installs with it: you configure the endpoint and the basic authentication credentials once, and the advanced_mautic_integration.api service hands out authenticated API objects to your own code.
$api_wrapper = \Drupal::service('advanced_mautic_integration.api'); $contacts = $api_wrapper->getApi('contacts'); $contacts->create([ 'email' => '[email protected]', 'firstname' => 'Someone', ]);
Built on that, the module can push Drupal users to Mautic whenever they are created or updated, with a field mapping of your choice.
Requirements
Drupal 10.3 or later, or Drupal 11, and the Token module. The README covers every setting.
Related modules
- Commerce Mautic Connect builds on this module to send Drupal Commerce orders and coupons to Mautic.
- Mautic Audiences builds on it to turn Mautic segments into Drupal audiences.
How does it relate to Google Tag Manager?
You can get similar tracking through Google Tag Manager, but not out of the box. This module is the simple path that just works, and it does not need a tag manager on the page.
Depends on
Dependencies of the latest stable release
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.