Installing the Mautic Drupal Module

The Drupal module for Mautic enables marketers to easily track contact’s activity on organizational websites. Rather than using a Mautic plugin to connect Mautic and Drupal, you’ll use a Drupal module – on the Drupal side, outside of Mautic. First, you’ll need to download the appropriate Drupal module for the Drupal version your site uses.

Drupal 7

Download the Mautic module for Drupal 7.x

  1. Within Drupal, navigate to Modules –> Install New Module
  2. Upload the .zip file you’ve downloaded
  3. Enable the Mautic module
  4. Configure the module by entering your Mautic URL. If you’re using a custom domain, be sure to use the URL with that custom domain (i.e. https://subdomain.yourdomain.com) rather than Mautic’s default domain (i.e. https://yourcompany.mautic.net).
  5. Go to Structure –> Blocks and drag the Mautic block to the footer. This adds the Mautic tracking script to every page on your website.

Once you’ve configured the Mautic module, you’ll also be able to use shortcode to add Mautic forms to your Drupal 7.x site.

Use this shortcode: {mauticform id=ID# width=300px height=300px}

Replace ID# with the Mautic form ID, which you can find in the form list or at the end of the URL for the form when you’re editing it in Mautic. Also, change the width and height to match the space where you’d like the form to appear on your site.

Drupal 8

Download the Mautic module for Drupal 8.x

  1. Install the module using Composer
  2. Enter your Mautic URL in the General Settings section. If you’re using a custom domain, be sure to use the URL with that custom domain (i.e. https://subdomain.yourdomain.com) rather than Mautic’s default domain (i.e. https://yourcompany.mautic.net).
  3. To exclude some pages from tracking with Mautic, list those pages in the “Tracking Page” section.

Drupal Module - D8 Mautic Module Configuration

Adding Forms in Drupal 8

The shortcode mentioned above for Drupal 7.x does not render Mautic forms in Drupal 8.x. To add a Mautic form to a Drupal 8.x page, you have a few other options.

  1. Add a form as you would to any other page
  2. Use Vardot’s Webform Mautic module