Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upper tracking request limit for a pageview to prevent flooding server/db #19132

Open
samjf opened this issue Apr 22, 2022 · 3 comments
Open
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@samjf
Copy link
Contributor

samjf commented Apr 22, 2022

Summary

Often times we come across a tracking bug or bots that continually cause tracking requests to be sent. This can flood the server and slow down the DB. I would expect that there should be some sort of realistic upper limit in the client JS that stops a single visitor from generating too many requests per page view.

It may be wise to implement some upper limit on the client JS so that such bugs/bots don't cause this issue so easily. A good example may be that we have 5000 requests within a virtual page view (virtual page view meaning the counter is reset as soon as someone calls trackPageView).

Your Environment

  • Matomo Version: 4.8
  • PHP Version: 8.1
  • Server Operating System: Mac
  • Additionally installed plugins: *
@samjf samjf added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label Apr 22, 2022
@MichaelRoosz
Copy link
Contributor

To protect your SQL Database and insert tracking data into it at a constant rate you may use https://plugins.matomo.org/QueuedTracking (requires a redis server)

To block bots and set some limits you may use https://plugins.matomo.org/TrackingSpamPrevention

@sgiehl
Copy link
Member

sgiehl commented Apr 26, 2022

@MichaelRoosz I guess the issue was more about the client side. So that the javascript tracking kind of counts the requests that were already sent on a certain page and when it reaches a limit further tracking requests would be dropped. That way they would not even reach the server.

@samjf
Copy link
Contributor Author

samjf commented Apr 27, 2022

@sgiehl Yes, this was what I was imagining.

An example of what i'm trying to avoid is say like 7000 form submissions in a single pageview by a single visitor. That wouldn't seem like a realistic usage of valid tracking.

I wonder if implement if this could cause trouble for SPA sites? Though, I would suspect that they would track virtual pageviews that could reset the limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

4 participants