I’m working on a website, and I’m wondering if there is a development mode, so that I don’t pollute the regular statistics when I test my website.
Right now, I have set up one Matomo site for production, and one for testing. But I’d prefer one site with a dev mode (that removes or separates test data), because this way I wouldn’t have to exactly mirror the first site with the second.
In case this is not 100% clear: I’m not looking for a dev mode to work on Matomo itself, or Matomo plugins.
The Matomo tracking code is just normal Javascript. So you can just adapt it so that in your development environment _paq.push(['trackPageView']); and similar functions are simply not called.
Or if you generate the HTML containing a tracking-code server-side you can just adapt your templating engine so that the _paq.push(['trackPageView']); line is not called during development.
Or if you don’t want to modify your site, you can tick a checkbox in the website settings so that Matomo only tracks the data if the URL of the site is your production URL.
I’m interested in a dev mode for developing features (on my website) that depend on Matomo (I forgot to mention that), so disabling Matomo wouldn’t work for me.
If there isn’t a dev mode like this, is there a way to clone a site within Matomo?
This way, I could config the production site, and then clone it to create the dev site.
You can enable a development mode in Matomo to help prevent test data from affecting your regular statistics by using the “Site Settings” and applying filters or configuring custom tracking settings for development traffic. One option is to create a separate tracking profile or tag in Matomo specifically for development, and use a condition (like a custom query parameter, cookie, or IP address) to differentiate test traffic from regular users. This way, you can track your testing without polluting the main data. Additionally, you could set up a custom plugin or use Matomo’s advanced tracking features, such as tracking via the API or custom JavaScript events, to exclude certain actions or sessions from being counted. This would allow you to maintain a single Matomo instance while ensuring that development data is either filtered out or stored separately.