Event Tracking with Matomo Tag Manager
Event tracking in Matomo allows you to monitor specific user actions on your website, such as button clicks and Ecommerce events. Tracking these events can reveal how visitors interact with your site to understand common interactions and user preferences.
You can set up event tracking using Matomo Tag Manager (recommended) or by adding JavaScript code snippets directly to your website.
Optional tracking to enrich your analytics
Extending your tracking setup in Matomo Tag Manager (MTM) can offer enhanced analytics beyond basic pageviews. In Tag Manager, you can track various user interactions, such as:
- Ecommerce Events: Monitor actions like product views, cart additions, or purchases.
- Page Scrolls: Understand how far visitors scroll, helping you identify whether your content is engaging.
- Button Clicks: Track clicks on call-to-action buttons to measure user engagement and conversions.
- Content Tracking: Monitor interactions with dynamic content, such as videos or embedded widgets.
Using triggers in Matomo Tag Manager, you can customise your tracking to capture these events and get actionable data.
Custom Events for tracking specific user interactions
Matomo Tag Manager’s flexibility enables you to create custom events to capture unique interactions that aren’t part of the default variables or triggers in Matomo. They are especially useful for Ecommerce, content-heavy websites, or tracking detailed engagement metrics.
Learn more about when not to use events and what to use instead.
While default tracking provides insights into general user behaviour, like pageviews, custom events let you measure unique interactions, for example:
- Identify the most popular products among visitors coming from specific traffic sources.
- Track engagement with key sections of a page, e.g., track scrolling below the fold, clicking on a specific button or email link.
- Measure interactions with interactive elements, such as menus, tabs, and other UI elements.
Advanced Event Tracking using the Data Layer
You can implement custom events to optimise your tracking setup and capture a more granular level of detail. Event data can be sent to the MTM data layer as each interaction occurs. For example, when a user adds an item to their cart, MTM can capture this event, allowing Matomo to track it and provide valuable information.
Google Tag Manager (GTM) Data Layer
If you’re already using Google Tag Manager, Matomo Tag Manager can read events from the GTM data layer and capture detailed interactions such as clicking buttons or submitting forms, without needing to recreate these tracking configurations in Matomo.
Take the next step and learn how to track events using the existing GTM dataLayer events and variables.