{"id":13518498,"url":"https://github.com/fnogatz/magento2-matomo","last_synced_at":"2025-04-06T20:13:05.843Z","repository":{"id":41832821,"uuid":"48323519","full_name":"fnogatz/magento2-matomo","owner":"fnogatz","description":"Matomo Analytics Module for Magento 2","archived":false,"fork":false,"pushed_at":"2024-05-31T08:01:33.000Z","size":242,"stargazers_count":51,"open_issues_count":14,"forks_count":38,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-30T18:10:03.645Z","etag":null,"topics":["agpl","composer","magento","magento2","magento2-module","matomo","piwik","piwik-tracking"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fnogatz.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-20T14:15:22.000Z","updated_at":"2024-11-18T09:48:50.000Z","dependencies_parsed_at":"2024-10-26T22:03:32.125Z","dependency_job_id":"19539e78-9877-43c2-8fab-5251db3fe4cc","html_url":"https://github.com/fnogatz/magento2-matomo","commit_stats":{"total_commits":115,"total_committers":9,"mean_commits":"12.777777777777779","dds":"0.33913043478260874","last_synced_commit":"3aaef162f129473c988d43154cf45567dd23609e"},"previous_names":["henkelund/magento2-henhed-piwik"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnogatz%2Fmagento2-matomo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnogatz%2Fmagento2-matomo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnogatz%2Fmagento2-matomo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnogatz%2Fmagento2-matomo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fnogatz","download_url":"https://codeload.github.com/fnogatz/magento2-matomo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543593,"owners_count":20955865,"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":["agpl","composer","magento","magento2","magento2-module","matomo","piwik","piwik-tracking"],"created_at":"2024-08-01T05:01:45.517Z","updated_at":"2025-04-06T20:13:05.819Z","avatar_url":"https://github.com/fnogatz.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Matomo Integration for Magento 2\n\n*Chessio_Matomo* is a [Matomo](https://matomo.org/) web analytics module for the [Magento 2](https://magento.com/) eCommerce platform. Matomo is an extensible free/libre analytics tool that can be self-hosted, giving you complete data ownership. Chessio_Matomo lets you integrate Matomo with your Magento 2 store front.\n\nThis module is the successor of [*Henhed_Piwik*](https://packagist.org/packages/henhed/module-piwik) and thus continues with its semantic versioning, beginning with version `v2.1.0` . If you're using a Magento version prior to 2.2, you'll need to stick to the 1.x releases of the original Henhed_Piwik. For manual installation, check out the [Releases archive](https://github.com/fnogatz/magento2-matomo/releases). For installation using [Composer](https://getcomposer.org/), you can use the *tilde* or *caret* version constraint operators (e.g. `~1.3` or `^1.3.1`).\n\n## Installation\n\nTo install Chessio_Matomo, download and extract the [main zip archive](https://github.com/fnogatz/magento2-matomo/archive/main.zip) and move the extracted folder to *app/code/Chessio/Matomo* in your Magento 2 installation directory.\n\n```sh\nunzip magento2-matomo-main.zip\nmkdir app/code/Chessio\nmv magento2-matomo-main app/code/Chessio/Matomo\n```\n\nAlternatively, you can clone the Chessio_Matomo Git repository into *app/code/Chessio_Matomo*.\n\n```sh\ngit clone https://github.com/fnogatz/magento2-matomo.git app/code/Chessio/Matomo\n```\n\nOr, if you prefer, install it using [Composer](https://getcomposer.org/).\n\n```sh\ncomposer require chessio/module-matomo\n```\n\nFinally, enable the module with the Magento CLI tool.\n\n```sh\nphp bin/magento module:enable Chessio_Matomo --clear-static-content\n```\n\n## Configuration\n\nOnce installed, configuration options can be found in the Magento 2 administration panel under *Stores/Configuration/Sales/Matomo API*.\nTo start tracking, set *Enable Tracking* to *Yes*, enter the *Hostname* of your Matomo installation and click *Save Config*. If you have multiple websites in the same Matomo installation, make sure the *Site ID* configured in Magento is correct.\n\n## Customization\n\nIf you need to send some custom information to your Matomo server, Chessio_Matomo lets you do so using event observers.\n\nTo set custom data on each page, use the `matomo_track_page_view_before` event. A tracker instance will be passed along with the event object to your observer's `execute` method.\n\n```php\npublic function execute(\\Magento\\Framework\\Event\\Observer $observer)\n{\n    $tracker = $observer-\u003egetEvent()-\u003egetTracker();\n    /** @var \\Chessio\\Matomo\\Model\\Tracker $tracker */\n    $tracker-\u003esetDocumentTitle('My Custom Title');\n}\n```\n\nIf you only want to add data under some specific circumstance, find a suitable event and request the tracker singleton in your observer's constructor. Store the tracker in a class member variable for later use in the `execute` method.\n\n```php\npublic function __construct(\\Chessio\\Matomo\\Model\\Tracker $matomoTracker)\n{\n    $this-\u003e_matomoTracker = $matomoTracker;\n}\n```\n\nBeware of tracking user specific information on the server side as it will most likely cause caching problems. Instead, use Javascript to retrieve the user data from a cookie, localStorage or some Ajax request and then push the data to Matomo using either the Chessio_Matomo JS component...\n\n```js\nrequire(['Chessio_Matomo/js/tracker'], function (trackerComponent) {\n    trackerComponent.getTracker().done(function (tracker) {\n        // Do something with tracker\n    });\n});\n```\n\n... or the vanilla Matomo approach:\n\n```js\nvar _paq = _paq || [];\n_paq.push(['setDocumentTitle', 'My Custom Title']);\n```\n\nSee the [Matomo Developer Docs](https://developer.matomo.org/api-reference/tracking-javascript) or the [\\Chessio\\Matomo\\Model\\Tracker](https://github.com/fnogatz/magento2-matomo/blob/main/Model/Tracker.php) source code for a list of all methods available in the Tracking API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnogatz%2Fmagento2-matomo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffnogatz%2Fmagento2-matomo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnogatz%2Fmagento2-matomo/lists"}