Send Real-Time Custom Events from Any App to Mautic (Beyond Page Views 🚀)

Mautic is already feature-rich, but user tracking is mostly limited to page views out of the box.
I’ve been working with a Custom Events Plugin for Mautic that lets you send real-time custom events from any application directly into the Mautic backend—and then use those events everywhere: segments, campaigns, analytics, and contact timelines.

:fire: What Problem Does This Solve?

Instead of only knowing which pages a user visited, you can now track what they actually did:

  • Added product to cart

  • Completed checkout

  • Registered for a webinar

  • Clicked a specific in-app button

  • Triggered any backend or frontend action

And all of this becomes actionable inside Mautic.

:puzzle_piece: Event Types

The plugin supports two types of events:

:one: Defined Events

Events you explicitly create from the UI.

When creating an event, you can define Event Properties, such as:

  • Purchase amount

  • Product category

  • Webinar date

Each property supports:

  • Name & Label

  • Description

  • Required / Optional

  • Data Type (Text, Number, Date, Boolean, etc.)

  • Default Value

  • Allow / Disallow data type mismatch

  • Optional mapping to Contact Fields (Email, Company, etc.)

:backhand_index_pointing_right: No limit on events or properties.

:two: Undefined Events (Auto-Created)

You can send events without defining them in advance.

Example using JS tracking:

mt('send', 'product_add',
  { productId: 2, quantity: 1 },
  { email: 'john@gmail.com', name: 'John' }
);

General syntax:

mt('send', eventName, eventData, contactData);

  • If the event doesn’t exist, it’s auto-created

  • Contacts are created or updated automatically

  • Uses mtc_id to track users across sessions/devices

  • Undefined events can later be converted into fully defined ones

:locked_with_key: Enabling Event Tracking

  1. Go to Settings → Configuration → Events Settings

  2. Copy the Secret Token

  3. Include it in all API / JS requests
    (Requests without it are rejected)

:globe_with_meridians: Event Tracking API

Endpoint

POST http://<your-mautic-url>/mtc/event/track

Headers

Content-Type: application/json
secret: <your-token>

Example

curl -X POST http://your.company.com/mtc/event/track \
  -H "Content-Type: application/json" \
  -H "secret: <token>" \
  -d '{
    "event": "product_purchase",
    "data": {
      "product_name": "Laptop",
      "amount": 1500
    },
    "contact": {
      "email": "john.doe@example.com"
    }
  }'

:bar_chart: Event Analytics

Each tracked event includes:

  • :chart_increasing: Timeline graph (with date filters)

  • :scroll: Full event history (contacts, properties, timestamps)

  • :puzzle_piece: Event property definitions

Great for debugging payloads and understanding behavior trends.

:office_worker: Contact Timeline

Whenever an event fires:

  • A Lead is created if it doesn’t exist

  • The event appears in the contact’s timeline with timestamp

  • Full visibility of user behavior in one place

:bullseye: Segment Filters (Very Powerful)

Each event automatically provides:

  • Date/Time filter

  • Count filter

Plus dynamic operators based on property type:

  • Text → contains, equals, starts with

  • Number → greater than, between

  • Date → before, after

  • Boolean → true / false

Example:

Contacts who triggered Product Purchase at least 3 times in the last 30 days with amount > 5000

:repeat_button: Campaign Decisions (Real-Time Automation)

You can now trigger campaigns based on Tracked Events:

  • Decision: Tracked Event → Product Purchase

  • Action: Send Thank You Email / Add to Segment / Update Points

Supports multiple events (OR condition) and integrates fully with the Campaign Builder.

:white_check_mark: Use Case Example

Open a Focus Item when a user adds a product to cart
Send follow-up email only if purchase doesn’t happen within X hours

If you’re using Mautic and want true behavioral tracking beyond page views, custom events open up a whole new level of automation.

Happy to answer questions or discuss real-world use cases :waving_hand:

1 Like