- What is phpsa/statamic-analytics used for?
- It is a Statamic 3 addon that adds analytics widgets to the control panel so editors can review traffic and page-performance metrics without switching to a separate analytics tool. The goal is to surface reporting inside the CMS where content decisions are made. It is aimed at Statamic sites running on Laravel, not at standalone non-Laravel applications.
- How do I install phpsa/statamic-analytics?
- Install it with Composer from your project root using composer require phpsa/statamic-analytics. After installation, follow the repository README to publish any config or assets and to register your analytics source. Then clear Statamic and Laravel caches and check the control panel dashboard for the new widgets.
- Which analytics sources does the package support?
- The package is built around a configurable analytics source, which the overview describes as something you set up rather than something baked in. The exact supported providers, required credentials, and configuration keys are listed in the repository README. Check that file before assuming a specific provider is supported, and confirm the source you use exposes the metrics the widgets display.
- Do I need to configure API credentials, and where should I store them?
- Usually yes: an analytics integration needs credentials or a property identifier for the source you connect. Put these in the package's config file via environment variables so they are not committed to version control. Keep the keys scoped to read-only analytics access where possible, and rotate them if they are exposed.
- Is it compatible with Statamic 4 or 5, and which Laravel versions does it support?
- The package is published for Statamic 3, so the safest assumption is that it targets Statamic 3 and the Laravel versions that Statamic 3 supports. Check the composer.json constraints and the README before installing it on a Statamic 4 or 5 site, since addon compatibility across major Statamic versions is not automatic. For a Laravel-only app without Statamic, this package is not the right fit.
- How do I control who can view the analytics widgets?
- Visibility is handled through Statamic's control panel permissions and user roles, so restrict the dashboard or the addon's widgets to the roles that should see traffic and performance data. If the package does not ship dedicated permissions, you can still control access via Statamic's dashboard configuration and role setup. Review the README for any addon-specific permission keys.
- Can I choose or rearrange which analytics widgets appear?
- Statamic lets you configure the control panel dashboard, so the usual approach is to add or remove the addon's widgets from your dashboard configuration. Some addons also allow publishing views or config to change which metrics are shown. Check the repository README for the exact widget names and any customization options before relying on that.
- How should I handle caching and API rate limits in production?
- Analytics APIs have quotas, so avoid fetching fresh metrics on every control panel page load; use the package's caching options or wrap the calls in a cache layer if it does not provide one. Set a sensible cache TTL that matches how often your editors need updated numbers, and monitor for rate-limit errors. Also make sure the widgets degrade gracefully if the analytics source is unavailable.
- How can I test the dashboard locally or in a staging environment?
- Use a separate analytics property or a staging source so test traffic does not pollute production reports, and verify the widgets render with the credentials configured in your staging .env. If the package's service classes are resolvable from the container, you can fake or stub the analytics client in tests. For a quick manual check, confirm the dashboard loads without errors and that each widget shows data or an empty state.
- What alternatives exist if this package does not fit my project?
- Alternatives include other Statamic analytics addons, embedding Google Analytics or Plausible reports directly, or building a custom Statamic widget that calls the analytics API you already use. General Laravel analytics packages can also feed data into your own dashboard, though they need extra work to appear inside the Statamic control panel. Check the package's maintenance activity and issue tracker before committing to it long-term.