{"id":14384499,"url":"https://github.com/matomo-org/matomo-nodejs-tracker","last_synced_at":"2025-08-23T17:31:57.099Z","repository":{"id":13059860,"uuid":"15740205","full_name":"matomo-org/matomo-nodejs-tracker","owner":"matomo-org","description":"A Node.js wrapper for the Matomo (Piwik) tracking HTTP API","archived":false,"fork":false,"pushed_at":"2023-02-28T04:56:28.000Z","size":494,"stargazers_count":118,"open_issues_count":12,"forks_count":42,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-14T00:59:43.531Z","etag":null,"topics":["analytics","nodejs","piwik"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matomo-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-01-08T16:04:02.000Z","updated_at":"2024-03-17T15:05:42.000Z","dependencies_parsed_at":"2023-07-19T12:31:40.798Z","dependency_job_id":null,"html_url":"https://github.com/matomo-org/matomo-nodejs-tracker","commit_stats":{"total_commits":86,"total_committers":17,"mean_commits":"5.0588235294117645","dds":0.7674418604651163,"last_synced_commit":"968aa8b52f54e33febb4ffabfeb4d68d59a862a2"},"previous_names":["fhemberger/piwik-tracker"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matomo-org%2Fmatomo-nodejs-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matomo-org%2Fmatomo-nodejs-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matomo-org%2Fmatomo-nodejs-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matomo-org%2Fmatomo-nodejs-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matomo-org","download_url":"https://codeload.github.com/matomo-org/matomo-nodejs-tracker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230605081,"owners_count":18252211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","nodejs","piwik"],"created_at":"2024-08-28T18:01:26.014Z","updated_at":"2024-12-21T12:30:37.724Z","avatar_url":"https://github.com/matomo-org.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Matomo Tracker [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]\n\n\u003e A wrapper for the Matomo Tracking HTTP API\n\n## Usage\n\nFirst, install `matomo-tracker` as a dependency:\n\n```shell\nnpm install --save matomo-tracker\n```\n\nThen, use it in your project:\n\n```javascript\nvar MatomoTracker = require('matomo-tracker');\n\n// Initialize with your site ID and Matomo URL\nvar matomo = new MatomoTracker(1, 'http://mywebsite.com/matomo.php');\n\n// Optional: Respond to tracking errors\nmatomo.on('error', function(err) {\n  console.log('error tracking request: ', err);\n});\n\n// Track a request URL:\n// Either as a simple string …\nmatomo.track('http://example.com/track/this/url');\n\n// … or provide further options:\nmatomo.track({\n  url: 'http://example.com/track/this/url',\n  action_name: 'This will be shown in your dashboard',\n  ua: 'Node.js v0.10.24',\n  cvar: JSON.stringify({\n    '1': ['custom variable name', 'custom variable value']\n  })\n});\n\n// … or trackBulk:\nvar events = [{\n  '_id': 'AA814767-7B1F-5C81-8F1D-8E47AD7D2982',\n  'cdt': '2018-03-22T02:32:22.867Z',\n  'e_c': 'Buy',\n  'e_a': 'rightButton',\n  'e_v': '2'\n},{\n  '_id': 'AA814767-7B1F-5C81-8F1D-8E47AD7D2982',\n  'cdt': '2018-03-22T02:33:52.962Z',\n  'e_c': 'Buy',\n  'e_a': 'leftButton',\n  'e_v': '4'\n}];\nmatomo.trackBulk(events, (resData) =\u003e {\n  // done.\n})\n```\n\nThat's it. For a complete list of options, see [Matomo's Tracking HTTP API Reference](https://developer.matomo.org/api-reference/tracking-api).\n\n## Advanced usage\n\nIf you renamed the tracking file `piwik.php` or `matomo.php` of your matomo instance, the following error will be thrown:\n\n```js\nnew MatomoTracker(1, 'http://matomo.my-site.com/my-file.php'))\n// ERROR: A tracker URL must end with \"matomo.php\" or \"piwik.php\"\n```\n\nTo skip this check, simply pass `true` as third argument to the constructor:\n\n```js\nnew MatomoTracker(1, 'http://matomo.my-site.com/my-file.php', true))\n// OK\n```\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License)\n\n[npm-url]: https://npmjs.org/package/matomo-tracker\n[npm-image]: https://img.shields.io/npm/v/matomo-tracker.svg\n\n[travis-url]: https://travis-ci.org/matomo-org/matomo-nodejs-tracker\n[travis-image]: https://img.shields.io/travis/matomo-org/matomo-nodejs-tracker.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatomo-org%2Fmatomo-nodejs-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatomo-org%2Fmatomo-nodejs-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatomo-org%2Fmatomo-nodejs-tracker/lists"}