A Node.js wrapper for the Matomo (formerly Piwik) tracking HTTP API. Version 2.2.4 is the latest stable release, supporting Node.js >= 10. The package enables server-side tracking of page views, events, goals, and custom dimensions via Matomo's HTTP API. Key differentiators: native promise support, bulk tracking, and customizable request options. The upcoming v3.0.0-beta introduces a TypeScript rewrite with better type safety. Compared to alternatives like 'piwik-tracker', this is the official library from the Matomo organization.
npm install matomo-trackerVerified import paths — ran on the pinned version, not inferred.
Initializes MatomoTracker with site ID and URL, sends a single page view, then demonstrates bulk tracking of two page views.
Replace all instances of 'PiwikTracker' with 'MatomoTracker' in your code.
Use promises/async-await and upgrade Node to >=10.
Ensure the URL ends with /matomo.php (or /piwik.php if using Piwik-based forks).
Check response data if needed, or rely on HTTP status code via track callback.
Check the TypeScript definitions and update import types accordingly.
Use `import MatomoTracker from 'matomo-tracker'` (no curly braces).
Upgrade Node to >=12 or use a bundler that supports package.json exports.
Ensure URL includes protocol, e.g., 'https://your-matomo-domain.example.com/matomo.php'.
Either provide a callback function or use the returned promise (preferred).
No dependency data recorded yet.