@matomoto opened this Issue on January 18th 2023

Matomo Version: 4.13.1
Matomo Update History: 4.11.0,4.10.1,4.9.1,4.7.0,4.6.2,4.6.1
Matomo Install Version: Unknown - pre 3.8.
Latest Available Version: 4.13.1

Hello, i observe my matomo tracking over a long time. What i don't like is the tracking of so called web-hopper. This viewer visit the page only few seconds, possible 0 seconds. This is not really a visit. But a visit is a visit and is tracked. One time tracked, always in the database.

There exist tricks to prevent the tracking of this web-hopper, with a setTimeout befor tracking, but by this possible page-hopper are not tracked. Then, page-hopper inside a website with few or 0 seconds per page are OK. The trick for that is a if (document.referrer.includes(window.location.hostname) === true) { // ... }. And the next trick, and trick, and trick ... it is endless.

I think, a function, that revoke a visit is the best for that. This needs a few rules and variables.

  • when visit have x seconds and x action after x seconds, than revoke it.

  • variable = default
    -- revoke_visit_time = 0
    -- revoke_visit_actions = 0
    -- revoke_after_seconds = 3600

if ((current_timestamp - visit_timestamp) > revoke_after_seconds) {
  if ((revoke_visit_time <= 0) && (revoke_visit_actions <= 0)) {
    // revoke it

The variables must be editable for matomo users.

@sgiehl commented on January 19th 2023 Member

@matomoto Thanks for creating this issue.
I think the best option to implement some custom code around the Matomo tracking is to use our Tag Manager.
It should allow you to do that.
Could you maybe provide some more information around the web-hopper? Does it maybe always have a certain user-agent or is it random?

@matomoto commented on January 19th 2023

@sgiehl . i don't remember the exactly name of this term, used by google search. It means, that internet-user use a search engine like google search and switch very fast between the linked websites and the search results. Google search says, that this is bad for the ranking. The internet-user used a internet search engine, this list results, and the user switched too fast between linked websites and search result page. He comes too fast back to the search result page and click the next linked result.

The too fast website switching and the bad effect of the ranking is the one. The other is, i don't must track this visits. This are for me not really visits.

@sgiehl commented on January 20th 2023 Member

@matomoto Ah ok. Now I understand what exactly you meant. Preventing the tracking of such "short time visits" is something we will implement in our javascript tracker. As mentioned before I guess the best solution would be to implement that using our TagManager or in the javascript snippet for the tracking code.

@matomoto commented on January 23rd 2023

This is my current solution with JavaScript:

function matomoloader() {
  // load matomo.js

if (document.referrer.includes(window.location.hostname) === true) {
} else {
  var matomoreadystate = setInterval(function() {
    // ↓ load matomo.js after document is fully loaded.
    if (document.readyState === "complete") {
      // ↓ load matomo.js after [n] milliseconds.
      setTimeout(function() {
      }, 1100);
  }, 100);
This Issue was closed on January 20th 2023
Powered by GitHub Issue Mirror