Form Capture

Updated on February 9, 2026

Form capture lets you collect email addresses from existing forms on your site and send them to Mautic in the background. Unlike subscribe forms, this feature does not require building a new form. You simply add a data attribute to any HTML form you already have, and the plugin handles the rest silently.

Enabling Form Capture

  1. Go to WooCommerce > Mautic Integration and click the Contact Sync tab.
  2. Scroll down to the Subscribe Forms section.
  3. Check the box labeled Enable automatic email capture from forms with data-mautic-woo attribute.
  4. Click Save Changes.

Adding the Attribute to a Form

To mark a form for capture, add the data-mautic-woo attribute to the form element. You can optionally include data-mautic-woo-tag to assign a tag to the captured contacts.

<form data-mautic-woo data-mautic-woo-tag="lead">
    <input type="email" name="email" placeholder="Your email">
    <button type="submit">Submit</button>
</form>

If you do not need a tag, you can use just the base attribute:

<form data-mautic-woo>
    ...
</form>

How It Works

When Form Capture is enabled, a small JavaScript file is loaded on every frontend page of your site. This script watches for form submit events on any form that has the data-mautic-woo attribute. Here is what happens when such a form is submitted:

  1. The script looks for an email input inside the form. It checks for input[type="email"] first, then falls back to input[name="email"].
  2. If an email value is found, the script sends it to your WordPress site in the background.
  3. Your site then forwards the email (and the tag, if specified) to Mautic.
  4. The original form submission continues normally without interruption.

The background request uses navigator.sendBeacon when available (supported in all modern browsers), which ensures the data is sent even if the page navigates away immediately after form submission. For older browsers, a standard asynchronous request is used instead.

No Form Rebuilding Needed

Form capture is designed to work with forms you already have. You do not need to change the form’s action, method, or field names. The capture script runs alongside the form’s normal behavior without interfering. Your form still submits to its original destination as usual.

This makes it compatible with contact forms, comment forms, login forms, checkout forms, and any other form that contains an email field. As long as you add the data-mautic-woo attribute and the form has an email input, it will work.

Use Cases

  • Contact form capture – Add the attribute to your Contact Us form to automatically create Mautic contacts from inquiries.
  • Comment form capture – Tag blog commenters in Mautic for follow-up campaigns.
  • Third-party form plugins – Works with forms from plugins like WPForms, Gravity Forms, or Contact Form 7, as long as you can add the data attribute to the form element.
  • Custom landing pages – Capture emails from lead generation forms without building a separate integration.

Limitations

  • The form must contain an input[type="email"] or input[name="email"] field. Other field types or names are not detected.
  • Only the email address and tag are sent to Mautic. Other form fields (name, message, etc.) are not captured.
  • The capture is silent. No success or error message is shown to the visitor. If you need user feedback, use the subscribe form shortcode instead.
  • If the email field is empty when the form is submitted, the capture is skipped quietly.