Mautic integration with Drupal
Introduction
Mautic is an open-source marketing automation platform designed to help businesses and organizations automate various marketing tasks and streamline their marketing efforts. Marketing automation offers an exciting opportunity for greater efficiency, cost reduction, and an enhanced customer experience.
The purpose of this blog is to guide you through the process of integrating Mautic with Drupal to enable seamless marketing automation and user tracking.
Step 1: Install Mautic on the local server
You can install Mautic using several methods:
- Using production package
- Cloning from GitHub
- Install with composer
After downloading a desired package, upload the package zip file to your web server, and unzip it in the directory where you plan to host the Mautic instance. Your web server must have the permissions to access the unzipped files. Before installing, Mautic checks the server environment. If the environment checks are successful, click on Next Step to begin the installation process. Now, enter the database information in the screen below:

Mautic Installation Screen1
After following all steps, Mautic will be installed successfully on the local server.
Now, the following steps are required to integrate Mautic with Drupal:
Step 1: Use Composer to download the module:
composer require drupal/mautic
Step 2: After installing, you need to configure Mautic with Drupal (/admin/config/system/mautic)

Mautic Configuration
Step 3: In Mautic, go to Components → Forms, select the form, and click on Public URL / Embed and copy the embed code like:

Embed Code
<script type="text/javascript" src="https://your-mautic-instance.com/form/generate.js?id=12"></script>
Step 4: Paste the above code into a Drupal page or block with Full HTML enabled.

Lead Form
Now you can track users’ data on the Mautic instance.

Users Data
Use Cases
The Drupal Lead Form data will be saved in Mautic, as shown in the screen above. You can now use this data for the following purposes:
- Track content engagement for scoring
- Convert anonymous visitors into leads via forms
- Personalise call-to-actions or banner messages
- Trigger email campaigns
Conclusion
Finally, you’ve successfully completed the installation of Mautic and its integration with Drupal. With everything in place, you can now effectively track user activity on your Drupal site directly within Mautic—enabling better insights, lead management, and personalised marketing automation.
Let us know in case of any issues during the integration process, and please feel free to reach out via comments.