{"library":"matomo-tracker","title":"Matomo Node.js Tracker","description":"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.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install matomo-tracker"],"cli":null},"imports":["import MatomoTracker from 'matomo-tracker'","const MatomoTracker = require('matomo-tracker')","const tracker = new MatomoTracker(siteId, url); tracker.track(params).then(...)","tracker.trackBulk([params1, params2]).then(...)"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import MatomoTracker from 'matomo-tracker';\n\nconst siteId = 1;\nconst matomoUrl = 'https://your-matomo-domain.example.com/matomo.php';\nconst tracker = new MatomoTracker(siteId, matomoUrl);\n\ntracker.track({\n  url: 'http://example.com/page',\n  action_name: 'Page Title',\n  uid: 'user123'\n}).then(response => {\n  console.log('Tracking response:', response);\n}).catch(err => {\n  console.error('Tracking failed:', err);\n});\n\n// Bulk tracking\ntracker.trackBulk([\n  { url: 'http://example.com/page1', action_name: 'Page 1', uid: 'user1' },\n  { url: 'http://example.com/page2', action_name: 'Page 2', uid: 'user2' }\n]).then(responses => {\n  console.log('Bulk tracking responses:', responses);\n}).catch(err => {\n  console.error('Bulk tracking failed:', err);\n});","lang":"typescript","description":"Initializes MatomoTracker with site ID and URL, sends a single page view, then demonstrates bulk tracking of two page views.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}