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.
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.
Event Types
The plugin supports two types of events:
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.)
No limit on events or properties.
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_idto track users across sessions/devices -
Undefined events can later be converted into fully defined ones
Enabling Event Tracking
-
Go to Settings → Configuration → Events Settings
-
Copy the Secret Token
-
Include it in all API / JS requests
(Requests without it are rejected)
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"
}
}'
Event Analytics
Each tracked event includes:
-
Timeline graph (with date filters) -
Full event history (contacts, properties, timestamps) -
Event property definitions
Great for debugging payloads and understanding behavior trends.
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
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
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.
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 ![]()