How to manage Hits usage and temporarily disable tracking in Matomo
If you want to stop tracking temporarily, you can disable Matomo tracking. This can help manage your monthly hits quota in Matomo Cloud or pause data collection in On-Premise.
Matomo does not provide a built-in mechanism that automatically stops tracking when a specific hit threshold is reached. For Matomo Cloud, you can manage this by monitoring usage and turning off tracking when required.
This guide explains setting up custom alerts for your hits quota and disabling tracking.
1. Configure custom alerts for hits usage
Set up quota usage alerts for your teams to receive notifications when Matomo hits usage reaches defined thresholds. These alerts help you monitor traffic levels, so you can respond and take action before exceeding your monthly quota.
- Log in to Matomo and go to Administration
> Personal > Alerts.
- Click Create New Alert and provide a name for the custom alert.
- In the Apply To section, choose the Website that the alert applies to.
- Choose how often Matomo should check the alert condition and send notifications (daily, weekly, or monthly).
-
Select how the alerts will be delivered. Notifications can be delivered through several channels, including email, SMS, or Slack.
-
Define the Alert Condition, for example, to monitor hits consumption.
- Hits is not a built-in alert metric, so you will need to create a Custom Report based on the Hits metric and use it as the alert source. Learn how to configure the alert condition for Hits consumption.
2. Disable tracking when hits limit reached
If your hits usage approaches the limit, you can temporarily disable tracking for Matomo Tag Manager or the JavaScript tracking code.
Disable the Matomo Tag Manager container
- The quickest way to turn off tracking in Matomo Tag Manager (MTM), is to pause your Matomo tracking tags and republish the container.
- Once the updated container is published, the Matomo tracking tag will no longer fire. Note that cached versions can continue sending tracking data until the cache expires.
- Developers can also comment out the MTM container script in the website’s production code. This prevents the container from loading while cached containers expire.
Remove the Matomo JavaScript tracking code
- If using the JavaScript tracking code instead of MTM, you can stop tracking by removing or commenting out the Matomo code snippet from your website.
- Locate the Matomo tracking code in your website templates.
- Comment out or remove the script that loads
matomo.js. - This requires updating your website code and deploying the change across your production environment. On large websites, this process may take longer because changes must propagate through templates, caching layers, or CDNs.
- Alternatively, set a temporary random URL in your website settings URLs field and force it to track only from that domain.
- Any hits received afterwards usually come from pages already open in visitors’ browsers.
3. Monitor administrative actions
It is recommended to restrict which users can disable tracking and review configuration changes regularly. Only users with Admin or Superuser permissions can pause tags and modify containers. Limiting these permissions helps prevent accidental or unauthorised changes that could stop data collection.
You can review administrative activity in Administration > Diagnostics > Activity Log. This log records configuration changes and administrative actions, allowing you to see who made a change in Matomo and when it occurred.
By combining usage alerts with clear internal procedures, you can manage hits consumption and respond quickly if traffic increases unexpectedly.