- Can I use nucleos/matomo-bundle in a Laravel application?
- No, not natively. nucleos/matomo-bundle is a Symfony bundle that depends on Symfony's kernel, service container, configuration component, and bundle conventions. Laravel would require shimming those Symfony services into its container, which adds ownership burden for little benefit. For Laravel, wrap matomo/matomo-php-tracker in a small service provider instead.
- How do I install and register nucleos/matomo-bundle in a Symfony application?
- Install it with Composer using composer require nucleos/matomo-bundle. Register the bundle in your Symfony bundles configuration, or let Symfony Flex do it if a recipe is available. Then configure your Matomo host, site ID, and any auth token through the bundle configuration. Confirm the installed version supports your Symfony version before relying on it.
- What configuration options does nucleos/matomo-bundle provide?
- The bundle provides configuration for Matomo tracking, including the Matomo host and site ID, and services for embedding tracking code. It also exposes Twig helpers and a block service so templates can render Matomo tracking without boilerplate. Exact option names should be checked against the bundle's README and config schema for your installed version.
- Does nucleos/matomo-bundle support Symfony 8?
- Yes, release 4.4.0 adds a Symfony 8 constraint, extending the bundle's compatibility through Symfony 8. Before upgrading, confirm the Composer constraint includes your current and target Symfony versions, such as a range covering 6.4, 7, and 8, rather than an additive-only constraint that could strand you. This release improves Symfony compatibility but does nothing for Laravel consumers.
- What are the alternatives to nucleos/matomo-bundle for Laravel analytics?
- The most direct alternative is matomo/matomo-php-tracker, the underlying Matomo PHP tracker, wrapped in a small Laravel service provider. You can also keep Matomo's JavaScript _paq snippet for client-side tracking, or use a dedicated Laravel analytics package if you do not specifically need Matomo. Treat the Symfony bundle as reference material for wiring patterns, not as a Laravel dependency.
- How do I embed Matomo tracking code in Twig with this bundle?
- The bundle provides Twig helpers and a block service intended to embed Matomo tracking code in Symfony templates. After configuring the Matomo host and site ID, call the provided Twig helper in your layout or relevant template. Verify the rendered output in a non-production environment before enabling it broadly. Check the bundle documentation for the exact helper name in your version.
- Is nucleos/matomo-bundle actively maintained and safe for production?
- It is MIT licensed and has recent maintenance activity, including Symfony 8 support and dependency refreshes in 4.4.0. However, the project has a narrow user base, around six GitHub stars and zero dependents, and effective human maintainership appears to be one person. The 4.4.0 release contains no functional changes, so treat it as maintenance churn rather than product evolution. Pin the version and have a fallback plan if maintenance stops.
- How can I test Matomo tracking integration without sending production analytics?
- Use a test Matomo host and site ID, or disable tracking in your test environment. Because the bundle integrates through Symfony's service container, you can inject a test double or mock for the tracker or block service and assert that tracking calls occur. Keep production credentials out of test configuration. Validate both template rendering and server-side event emission separately.
- What is the block service in nucleos/matomo-bundle and do I need it?
- The block service is the bundle's abstraction for embedding Matomo tracking inside Symfony applications, backed by configuration and Twig integration. It is useful if you want dependency injection, centralized config, and template helpers without writing that glue yourself. If you only need to fire Matomo tracker calls, a thin wrapper around matomo/matomo-php-tracker has fewer dependencies and is easier to port to Laravel.
- What privacy or GDPR concerns should I consider when using Matomo with this bundle?
- The bundle helps embed Matomo tracking, but it does not by itself make your analytics legally compliant. You still need to configure Matomo privacy settings such as IP anonymization, cookie consent behavior, data retention, and user opt-out according to your jurisdiction. Confirm consent is collected before tracking where required. Review both the Matomo server configuration and your application's consent flow before production use.