Skip to content

Tracking events

Events let you measure the actions that matter — sign-ups, purchases, downloads, or anything else — beyond page views.

Call track on the global mad object with a name and, optionally, properties:

mad.track('purchase', {
plan: 'pro',
amount: 49,
currency: 'EUR',
});

Event names are free-form strings. Properties are key–value pairs you can break down and filter by in the dashboard.

For simple cases, add data attributes to any element and the tracker handles the click:

<button data-mada-event="download" data-mada-event-file="report.pdf">
Download report
</button>

See the tracker script reference for the other accepted attribute prefixes.

  • Keep event names stable and lowercase — checkout_started, not Checkout Started.
  • Use properties for variation instead of encoding it in the name.
  • Don’t send personal data in properties. Madinco Hub is built to stay privacy-friendly.