How do I track single-page applications with Matomo?
For SPAs (React, Vue, Angular), use the Matomo JavaScript Tracking Client. Call _paq.push(["setCustomUrl", url]) and _paq.push(["trackPageView"]) on each route change in your application.
If you use Matomo Tag Manager, configure a “History Change” trigger to automatically detect URL changes. This handles most SPA frameworks without custom code.
Have some questions? We have your solution.