{"id":20617633,"url":"https://github.com/joernroeder/piwik-react-router","last_synced_at":"2025-08-21T00:31:53.636Z","repository":{"id":30426802,"uuid":"33979747","full_name":"joernroeder/piwik-react-router","owner":"joernroeder","description":"Piwik analytics component for react-router","archived":true,"fork":false,"pushed_at":"2018-10-11T15:33:24.000Z","size":100,"stargazers_count":61,"open_issues_count":17,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-11T23:58:23.957Z","etag":null,"topics":["history","javascript","piwik","react","react-router"],"latest_commit_sha":null,"homepage":"https://www.npmjs.org/package/piwik-react-router","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/joernroeder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-15T07:33:05.000Z","updated_at":"2025-06-20T16:01:47.000Z","dependencies_parsed_at":"2022-09-06T06:42:13.922Z","dependency_job_id":null,"html_url":"https://github.com/joernroeder/piwik-react-router","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/joernroeder/piwik-react-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joernroeder%2Fpiwik-react-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joernroeder%2Fpiwik-react-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joernroeder%2Fpiwik-react-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joernroeder%2Fpiwik-react-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joernroeder","download_url":"https://codeload.github.com/joernroeder/piwik-react-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joernroeder%2Fpiwik-react-router/sbom","scorecard":{"id":527303,"data":{"date":"2025-08-11","repo":{"name":"github.com/joernroeder/piwik-react-router","commit":"9e618ad27c5c60e421d15d45607783c0c4513742"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 2/18 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T04:44:40.291Z","repository_id":30426802,"created_at":"2025-08-20T04:44:40.291Z","updated_at":"2025-08-20T04:44:40.291Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271409428,"owners_count":24754712,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["history","javascript","piwik","react","react-router"],"created_at":"2024-11-16T12:05:08.362Z","updated_at":"2025-08-21T00:31:53.378Z","avatar_url":"https://github.com/joernroeder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Piwik React Router\n\n[![npm package](https://img.shields.io/npm/v/piwik-react-router.svg?style=flat-square)](https://www.npmjs.org/package/piwik-react-router)\n[![dependency status](https://img.shields.io/david/peer/joernroeder/piwik-react-router.svg?style=flat-square)](https://david-dm.org/joernroeder/piwik-react-router)\n[![Build Status](https://travis-ci.org/joernroeder/piwik-react-router.svg?branch=master)](https://travis-ci.org/joernroeder/piwik-react-router)\n[![Coverage Status](https://coveralls.io/repos/github/joernroeder/piwik-react-router/badge.svg?branch=master)](https://coveralls.io/github/joernroeder/piwik-react-router?branch=master)\n\n[Piwik](https://piwik.org) analytics component for [react-router](https://github.com/rackt/react-router)\n\n\n## Installation\n\n\tnpm install piwik-react-router --save\nor\n\n\tyarn add piwik-react-router\n\n\n## Features\n\n- asynchronous loading of Piwik\n- javascript error tracking\n- low level access to [`piwik.push()`](#push-args)\n\n\n## Usage\n\nSimply create your instance with the same `url` and `siteId` as described in the piwik [documentation](https://developer.piwik.org/guides/tracking-javascript-guide) and connect it to your `history` object.\n\n_Starting with v2.0 react-router won't provide a default history. [Why?](https://github.com/rackt/react-router/blob/master/upgrade-guides/v2.0.0.md#no-default-history)_.\n\n```jsx\nconst PiwikReactRouter = require('piwik-react-router');\n\nconst piwik = PiwikReactRouter({\n\turl: 'your-piwik-installation.com',\n\tsiteId: 1\n});\n\n/**\n * Create your history in advance. Please head over to the react-router FAQ for more infos:\n * @see https://github.com/ReactTraining/react-router/blob/master/FAQ.md#how-do-i-access-the-history-object-outside-of-components\n*/\n\u003cRouter history={piwik.connectToHistory(history)}\u003e\n\t\u003cRoute path=\"/\" component={MyComponent} /\u003e\n\u003c/Router\u003e\n```\n\nIf you're using react-router prior to v1.0 please head over to the [react-router0.13.x branch](https://github.com/joernroeder/piwik-react-router/tree/react-router0.13.x).\n\nFor the url-option you can also include `http://` or `https://` in the beginning of the url, if you piwik installation is on ssl, but your react-site is not, or visa versa.\n\n\n\n## Options\n\n### enableLinkTracking: `true`\n\n[Link tracking](http://developer.piwik.org/api-reference/tracking-javascript#using-the-tracker-object) to track outgoing and download links is enabled by default.\n\n\n### userId: `undefined`\n\n[User ID](http://developer.piwik.org/api-reference/tracking-javascript#using-the-tracker-object) to associate every request with a username or email. More information here: [User ID](http://piwik.org/docs/user-id/)\n\n\n### updateDocumentTitle: `true`\n\nUpdates the document title before adding a new page view as the title may changed during the route rendering. Make sure you call `piwik.track` __after__ React has rendered the `\u003cHandler /\u003e` to make this work correctly.\nIf you don't know how to update the title, check out the great [react-document-title](https://github.com/gaearon/react-document-title) or [react-helmet](https://github.com/nfl/react-helmet) module.\n\n\n### trackErrors: `false`\n\nBy enabling this option occurring javascript errors will be tracked as a `JavaScript Error` piwik event.\n\nsee [http://davidwalsh.name/track-errors-google-analytics](http://davidwalsh.name/track-errors-google-analytics) for further details\n\n\n### trackErrorHandler: [default error handler]\n\nSet a custom error handler for javascript errors, allowing custom formatting of events published when an error occurs.\n\nsee [Tracking Events](http://piwik.org/docs/event-tracking/#tracking-events) for further details\n\n### ignoreInitialVisit: `false`\n\nBy enabling `ignoreInitialVisit` it connects to the history without tracking the initial visit.\n\n\n### injectScript: `true`\n\nBy disabling `injectScript` the `piwik.js` script will not be injected automatically to allow a separate loading.\n\nStarting with version `0.12.0` the usually required options `siteId` and `url` are now optional if a running instance of the piwik tracking script is detected by validating the following cases:\n\n- A `\u003cscript\u003e` src matches the url defined via `opts.url` and `opts.clientTrackerName`\n- `siteId` and `setTrackerUrl` calls are already present in `window._paq`\n\n\n### clientTrackerName: `'piwik.js'`\n\nThe name of the `piwik.js` static resource on the Piwik server. Set this option if the Piwik instance uses a different name.\n\n\n### serverTrackerName: `'piwik.php'`\n\nThe name of the `piwik.php` script on the Piwik server. Set this option if the Piwik instance uses a different name.\n\n\n## API\n\n### track (Location location)\n\nAdds a page view from a history [Location](https://github.com/rackt/history/blob/master/docs/Location.md) if the `path` changed.\n\n`path = location.pathname + location.search`\n\n\n### push (args)\n\nPushes the specified args to the Piwik tracker the same way as you're using the `_paq.push(args);` directly. You can use this method as the low-level api to call methods from the [Piwik API](http://developer.piwik.org/api-reference/tracking-javascript#list-of-all-methods-available-in-the-tracking-api), [track events](http://piwik.org/docs/event-tracking/#tracking-events) or call [custom functions](http://developer.piwik.org/guides/tracking-javascript-guide).\n\n\n### setUserId (userId)\n\nSets the specified user id to the Piwik tracker after `PiwikReactRouter` has been initialized. It wraps around the `'setUserId'` method of Piwik [User ID](https://developer.piwik.org/guides/tracking-javascript-guide#user-id)\n\n\n### trackError (error, [eventName])\n\nTracks the given error as a new [Piwik Event](http://piwik.org/docs/event-tracking/#tracking-events) for the given event name. If you don't specify any name here it will fallback to `JavaScript Error`.\n\nThe handler is overriden if the `trackErrorHandler` option is set.\n\n\n### connectToHistory(history, [modifier])\n\nAdds a listener to the passed in `history` to trigger `track(location)` whenever the history changes. The optional modifier function (added in version `0.9.0`) acts as a proxy to allow the modification of the given location before the `track(location)` function is called.\n\n```jsx\nconst modifier = function (location) {\n\tlocation.search = 'campain=ID';\n\n\treturn location;\n}\n\n\u003cRouter history={piwik.connectToHistory(history, modifier)}\u003e\n```\nConnecting to the history also tracks the location of the initial visit since release `0.7.0` if not manually disabled via [`ignoreInitialVisit`](#ignoreinitialvisit-false)\n\n### disconnectFromHistory()\n\nDisconnects Piwik from a previous connected history. Returns whether it could successfully disconnect.\n\n\n## A note on serverside rendering\n\nPiwik tracking is disabled for serverside rendering and all API methods are replaced with noop-functions so you don't have to worry about it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoernroeder%2Fpiwik-react-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoernroeder%2Fpiwik-react-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoernroeder%2Fpiwik-react-router/lists"}