{"id":18773116,"url":"https://github.com/webfactory/piwik-bundle","last_synced_at":"2025-05-07T15:20:31.613Z","repository":{"id":20630620,"uuid":"23912313","full_name":"webfactory/piwik-bundle","owner":"webfactory","description":"Symfony Bundle with twig-function for the Matomo (fka Piwik) tracking code","archived":false,"fork":false,"pushed_at":"2024-08-27T11:35:34.000Z","size":83,"stargazers_count":38,"open_issues_count":4,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-28T09:50:51.508Z","etag":null,"topics":["bundle","matomo","php","piwik","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/webfactory.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}},"created_at":"2014-09-11T09:34:11.000Z","updated_at":"2025-01-23T18:42:27.000Z","dependencies_parsed_at":"2024-03-07T10:47:26.879Z","dependency_job_id":"52dfbe21-62d8-43a3-9128-c1febc247e9c","html_url":"https://github.com/webfactory/piwik-bundle","commit_stats":{"total_commits":92,"total_committers":16,"mean_commits":5.75,"dds":0.6413043478260869,"last_synced_commit":"1e1cb796e8dfa774f51818e0a515443ca184b7b5"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfactory%2Fpiwik-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfactory%2Fpiwik-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfactory%2Fpiwik-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfactory%2Fpiwik-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webfactory","download_url":"https://codeload.github.com/webfactory/piwik-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902673,"owners_count":21822274,"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":["bundle","matomo","php","piwik","symfony"],"created_at":"2024-11-07T19:32:51.337Z","updated_at":"2025-05-07T15:20:31.592Z","avatar_url":"https://github.com/webfactory.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![webfactory Logo](http://www.webfactory.de/bundles/webfactorytwiglayout/img/logo.png) WebfactoryPiwikBundle\n============\n\n[![Run Tests](https://github.com/webfactory/piwik-bundle/workflows/Run%20Tests/badge.svg)](https://github.com/webfactory/piwik-bundle/workflows/)\n[![Coverage Status](https://coveralls.io/repos/webfactory/piwik-bundle/badge.png?branch=master)](https://coveralls.io/r/webfactory/piwik-bundle?branch=master)\n\nA Symfony Bundle that helps you to use the Matomo (formerly known as Piwik) Open Analytics Platform with your project.\n\nIt contains a Twig function that can insert the tracking code into your website. Plus, you can turn it off with a simple configuration switch so you don't track your dev environment.\n\n\nInstallation\n------------\n\n    composer require webfactory/piwik-bundle\n\nAnd enable the bundle in `app/AppKernel.php`:\n\n```php\n\u003c?php\n// app/AppKernel.php\n\npublic function registerBundles()\n{\n    $bundles = array(\n        // ...\n        new Webfactory\\Bundle\\PiwikBundle\\WebfactoryPiwikBundle(),\n    );\n}\n```\n\nUsage\n-----\nSomewhere in your views, right before the closing `\u003c/body\u003e` tag, insert \n\n\t{{ piwik_code() }}\n\nThis will add the appropriate Matomo tracking code as [described in the API reference](https://developer.matomo.org/api-reference/tracking-javascript#where-can-i-find-the-piwik-tracking-code).\n\nConfiguration\n-------------\nYou can configure the bundle in your `config.yml`. Full Example:\n\n```yaml\nwebfactory_piwik:\n    # Required, no default. Must be set to the site id found in the Matomo control panel\n    site_id: 1\n    # Required. no default. Hostname and path to the Matomo host.\n    piwik_host: my.piwik.hostname\n    # Optional, has default. Usually, you only want to include the tracking code in a production environment\n    disabled: '%kernel.debug%'\n    # Optional, has default. Path to the tracking script on the host.\n    tracker_path: \"/js/\"\n    # Optional, has default. Disable cookies in favor of GDPR\n    # https://matomo.org/faq/new-to-piwik/how-do-i-use-matomo-analytics-without-consent-or-cookie-banner/ \u0026 https://matomo.org/faq/general/faq_157/\n    disable_cookies: true\n```\n\nAdd calls to the JavaScript tracker API\n---------------------------------------\n\nThe [JavaScript tracking API](http://developer.matomo.org/api-reference/tracking-javascript) provides a lot of methods\nfor setting the page name, tracking search results, using custom variables and much more.\n\nThe generic `piwik()` function allows you to control the `_paq` variable and add additional API calls to it. For example,\nin your Twig template, you can write\n\n```twig\n    \u003c!-- Somewhere in your HTML, not necessarily at the end --\u003e\n    {{ piwik(\"setDocumentTitle\", document.title) }}\n    {{ piwik(\"trackGoal\", 1) }}\n\n    \u003c!-- Then, at the end: --\u003e\n    {{ piwik_code() }}\n    \u003c/body\u003e\n```\n\nNote that when you call `trackSiteSearch`, this will automatically disable the `trackPageView` call made by default.\nThis is the [recommended](http://developer.matomo.org/api-reference/tracking-javascript#tracking-internal-search-keywords-categories-and-no-result-search-keywords)\nbehaviour.\n\nCredits, Copyright and License\n------------------------------\n\nThis code was written by webfactory GmbH, Bonn, Germany. We're a software development\nagency with a focus on PHP (mostly [Symfony](http://github.com/symfony/symfony)). If you're a\ndeveloper looking for new challenges, we'd like to hear from you!\n\n- \u003chttps://www.webfactory.de\u003e\n- \u003chttps://twitter.com/webfactory\u003e\n\nCopyright 2012 – 2020 webfactory GmbH, Bonn. Code released under [the MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebfactory%2Fpiwik-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebfactory%2Fpiwik-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebfactory%2Fpiwik-bundle/lists"}