WP Manifestindependent plugin directory
manifest / integrations / lenonleitewordpresswoopluginmautic

LenonLeite WordPress Mautic

Plugin to connect WordPress Woocomerce with Mautic

by Lenon Leite · github.com/lenonleite/lenonleitewordpresswoopluginmautic

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/lenonleite/lenonleitewordpresswoopluginmautic/archive/refs/heads/main.zip

Sync WordPress users and WooCommerce customers to Mautic contacts.

Features

  • Connects WordPress to Mautic using OAuth2.
  • Syncs WordPress users when they register or update their profile.
  • Syncs WooCommerce customers when orders are created or completed.
  • Stores the Mautic contact ID in WordPress user/order meta.
  • Applies configurable Mautic tags.
  • Adds product purchase tags like purchased-product-slug.
  • Can add the Mautic tracking script to the frontend.

Installation

  1. Copy this plugin folder to:

    wp-content/plugins/lenonleite-wordpress-mautic
  2. In WordPress admin, go to:

    Plugins
  3. Activate:

    LenonLeite WordPress Mautic
  4. Open the plugin settings:

    Settings > Mautic Sync

    Or direct URL:

    /wp-admin/options-general.php?page=llwm-mautic-sync

Connect Mautic

The plugin uses Mautic OAuth2 credentials.

1. Enable the Mautic API

In Mautic admin:

  1. Go to Settings.
  2. Open Configuration.
  3. Open API Settings.
  4. Enable the API.
  5. Save the configuration.

2. Create OAuth2 credentials in Mautic

In Mautic admin:

  1. Go to Settings.
  2. Open API Credentials.
  3. Create a new credential.
  4. Select OAuth2.
  5. Use the Redirect URI shown on the WordPress plugin settings page.

For production, it should look like:

https://www.example.com/wp-admin/options-general.php?page=llwm-mautic-sync

After saving, Mautic will give you:

  • Public Key
  • Secret Key

3. Save credentials in WordPress

In WordPress admin:

  1. Go to Settings > Mautic Sync.

  2. Enter the Mautic URL, for example:

    https://m.example.com
  3. Enter the Public Key.

  4. Enter the Secret Key.

  5. Click Save Changes.

4. Authorize with Mautic

After saving the credentials:

  1. Click Re-authorize with Mautic.
  2. WordPress redirects you to Mautic.
  3. Approve the connection in Mautic.
  4. Mautic redirects back to WordPress.
  5. The plugin stores the access token and refresh token.

Then click:

Test Mautic Connection

Sync Behavior

WordPress Users

When user sync is enabled:

  • A Mautic contact is created or updated when a user registers.

  • A Mautic contact is updated when a user profile changes.

  • The Mautic contact ID is stored in user meta:

    _llwm_mautic_contact_id

Default registration tag:

wordpress-user

WooCommerce Orders

When WooCommerce order sync is enabled:

  • A Mautic contact is created or updated when an order is processed.

  • A Mautic contact is updated when an order becomes completed.

  • The Mautic contact ID is stored in order meta:

    _llwm_mautic_contact_id

Default customer tag:

woocommerce-customer

Default completed order tag:

woocommerce-order-completed

Product purchase tags are added automatically:

purchased-product-slug

Example:

purchased-blue-shirt

Field Mapping

Mautic receives fields by alias. The plugin settings page includes field mapping sections for:

  • WordPress users
  • WooCommerce orders

Each input should contain the Mautic field alias where that value should be sent.

Default WordPress user mapping:

User email  -> email
First name  -> firstname
Last name   -> lastname

Default WooCommerce order mapping:

Billing email      -> email
Billing first name -> firstname
Billing last name  -> lastname
Billing phone      -> phone
Billing address 1  -> address1
Billing address 2  -> address2
Billing city       -> city
Billing state      -> state
Billing postcode   -> zipcode
Billing country    -> country

To use custom Mautic fields:

  1. Create the custom field in Mautic.
  2. Copy the field alias from Mautic.
  3. Paste the alias into the matching field mapping input in WordPress.
  4. Click Save Changes.

Example:

If you create a Mautic custom field with alias:

wc_billing_phone

You can map:

Billing phone -> wc_billing_phone

Migration

The plugin can sync existing records from WordPress to Mautic.

In WordPress admin:

  1. Go to Settings > Mautic Sync.
  2. Make sure Mautic is authorized.
  3. Check the field mapping.
  4. Use one of the migration buttons:
Sync Existing WordPress Users
Sync Existing WooCommerce Orders

The migration uses the same field mapping and tags as normal sync.

For safety, each migration action currently processes up to 500 records per click.

Settings

The settings page contains:

  • Mautic URL: your Mautic base URL.
  • Public Key: OAuth2 public/client key from Mautic.
  • Secret Key: OAuth2 secret from Mautic.
  • Access Token: stored after authorization.
  • Refresh Token: stored after authorization.
  • Add Mautic tracking script: adds mtc.js to the frontend.
  • Sync WordPress users: enables user sync.
  • Sync WooCommerce orders: enables order sync.
  • Registration tags: tags applied to registered users.
  • Customer tags: tags applied when an order is created.
  • Completed order tags: tags applied when an order is completed.
  • Field mapping inputs for WordPress users and WooCommerce orders.
  • Migration buttons for existing users and orders.

Tags should be comma-separated:

wordpress-user, newsletter, customer

Current Limitations

  • Product tags are automatic and based on product slug.
  • Manual migration currently processes up to 500 records per click.
  • Sync runs during the related WordPress/WooCommerce hook; a background queue can be added later for large stores.
  • Only Mautic is supported.