MIXIN: WordPress

Total Files0
Size0.00 KB
Create DateDecember 16, 2017
Last UpdatedDecember 22, 2017

Mautic WordPress plugin Build Status Scrutinizer Code Quality Code Coverage

Mautic WordPress Plugin injects Mautic tracking script and image in the WP website. Your Mautic instance will be able to track information about your visitors. You can also insert Mautic content inside your website using different shortcodes.

Key features

  • You don't have to edit source code of your template to insert tracking code.
  • Plugin adds additional information to tracking image URL so you get better results than using just plain HTML code of tracking image.
  • You can use Mautic form embed with shortcode described below.
  • You can choose where the script is injected (header / footer)


Via WP administration

Mautic - WordPress plugin is listed in the in the official WordPress plugin repository. That makes it very easy to install it directly form WP administration.

  1. Go to Plugins / Add New.
  2. Search for WP Mautic in the search box.
  3. The "WP Mautic" plugin should appear. Click on Install.

Via ZIP package

If the installation via official WP plugin repository doesn't work for you, follow these steps:

  1. Download ZIP package.
  2. At your WP administration go to Plugins / Add New / Upload plugin.
  3. Select the ZIP package you've downloaded in step 1.


Once installed, the plugin must appared in your plugin list :

  1. Enable it.
  2. Go to the settings page and set your Mautic instance URL.

And that's it !


Mautic Tracking Script

Tracking script works right after you finish the configuration steps. That means it will insert the mtc.js script from your Mautic instance. You can check HTML source code (CTRL + U) of your WP website to make sure the plugin works. You should be able to find something like this:


    mt('send', 'pageview');

Custom attributes handling

If you need to send custom attributes within Mautic events, you can use the wpmautic_tracking_attributes filter.

add_filter('wpmautic_tracking_attributes', function($attrs) {
    $attrs['preferred_locale'] = $customVar;
    return $attrs;

The returned attributes will be added to Mautic payload.

Mautic Forms

To load a Mautic Form to your WP post, insert this shortcode to the place you want the form to appear:

Replace the "slot_name" with the slot name you'd like to load. This corresponds to the slot name you defined when building your campaign and adding the "Request Dynamic Content" contact decision.

Mautic Gated Videos

Mautic supports gated videos with Youtube, Vimeo, and MP4 as sources.

To load gated videos into your WP content, insert this shortcode where you'd like it to appear:

Please define a valid video type with video-type="#".
Please define a valid video type with video-type="#".

Replace the # signs with the appropriate number. For gate-time, enter the time (in seconds) where you want to pause the video and show the mautic form. For form-id, enter the id of the mautic form that you'd like to display as the gate. Replace URL with the browser URL to view the video. In the case of Youtube or Vimeo, you can simply use the URL as it appears in your address bar when viewing the video normally on the providing website. For MP4 videos, enter the full http URL to the MP4 file on the server.

Since the Mautic v2.9.1 release, the form-id is not mandatory anymore, mautic video can be tracked.

Mautic Tags

You can add or remove multiple lead tags on specific pages using commas. To remove an tag you have to use minus "-" signal before tag name:

Mautic Tags