Plugins: WordPress

Mautic is now part of Acquia, the company behind the Drupal CMS. However, our open philosophy means we’ll still play nicely with any other tools in your MarTech stack. This includes other CMS tools like WordPress.

The WordPress plugin for Mautic enables marketers to easily track contact’s activity on organizational websites. It also helps marketers add content and personalize the web experience with communication channels in just a few quick steps.

Setting up the WP Mautic Plugin

Whether you’re using or, adding the plugin to connect with Mautic is simple. Go to the Plugins section in your WordPress admin panel, and search for WP Mautic.

WP Mautic

Once installed, navigate to the Settings page.

Wordpress Plugin Settings

Mautic URL: All you need to do connect your Mautic instance to your WordPress account is add the Mautic URL. If you have a custom domain set up, be sure to use that (i.e. instead of

Tracking script location: Choose if you’d like to have the tracking script in the header or the footer of the page. Generally, we recommend adding tracking scripts in the footer. It doesn’t add much to the load time for the page, but if you have several tracking scripts in the header it could slow down the page load and hamper the user experience.

Tracking image: If a website visitor has JavaScript disabled, Mautic can add a tracking image.

Logged user: To track user activity (you and your team) while you’re logged into Mautic, check this box. We recommend unchecking it, because you’re likely looking at, tweaking, and testing your page regularly. You won’t want to have all those hits improperly inflating your traffic statistics. If this is unchecked, you’ll need to use an incognito window or different browser to test actions in Mautic.

Once you save these changes, WordPress will automatically add the Mautic tracking code to all pages on that site. You can connect the same Mautic instance/URL to multiple WordPress sites, but cannot use the plugin for multiple Mautic instances on the same site. To add the tracking code for additional Mautic instances, copy it from the Configuration –> Tracking Settings section of your Settings panel and paste it into your header or footer.

Shortcodes for content

Once you’ve connected your Mautic instance and WordPress site, you can easily add content. The plugin enables shortcodes to add dynamic web content, focus items, forms, and gated video to your site. You can also add or remove tags to and from contact records based on which pages a contact visits.

For each of these codes, replace ID# with the ID number of the item. You can find this in the far right column on the item list in your Mautic instance.

Important: Rather than using ( ) around each shortcode, use square brackets [ ]. Using square brackets on this WordPress page makes WordPress think we’re adding a Mautic item.

Dynamic Web Content: (mautic type=”content” slot=”slot_name“) {Insert Default Content here} (/mautic)

Inserting default content ensures that the contact sees something in that slot, even if they haven’t previously been tracked or they don’t meet the criteria for your Dynamic Content slot.

Focus Item: (mautic type=”focus” id=”ID#“)

Form: (mautic type=”form” id=”ID#“)

Note: If you prefer to use your own forms that are already in place, you can pass the data back to Mautic forms via API.

Using the PHP form library, you can also cookie the contact on form submission to begin tracking. If you don’t use the PHP form library, contacts won’t be tracked after submitting your non-Mautic forms.

Gated Video: (mautic type=”video” gate-time=”seconds” form-id=”ID#” src=”URL“)

For the gate-time, enter the time (in seconds) after which you’d like the form to appear. This may be right at the beginning, so the visitor can’t see any portion of the video until you’ve collected some data from them. You may want it right at the end, after the visitor has watched the entire video. Or, you may gate the video after a short period to hook the visitor and require them to exchange some information for access to the rest of the video.

In this shortcode, the ID# applies to the form you’d like to use since there’s no Gated Video item in Mautic. You’ll want to test the form to make sure it fits well inside the video, and may need to change some styling for the fields and/or submit button.

The URL for the source may be a straight forward link from YouTube, Vimeo, Wistia, etc. Or, to add an .mp4 file, use the full http:// or https:// link for where the file lives on its host server.

You may also just add a video and track views on a contact record without gating. To make that change, remove the gate-time and form-id parts of this shortcode.

Tags: (mautic type=”tags” values=”tag1, tag2, -tag3“)

Add any tags you’d like to add in place of tag1 or tag2 (as many as you’d like, separated by a comma). To remove a possible existing tag on a contact record, include “-” before the tag name.


Note: The WP Mautic plugin is an open source plugin, built and supported by the Mautic community. For the original documentation and contributors, click here.