matomo-org / matomo-org/plugin-TrackingSpamPrevention

Track only if ISP (name)

Open
#112 28 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
18
Forks
10
Avg merge
20h 11m
Merged PRs (30d)
1

Description

Because, there are more Bots as in the 5 Cloud IP list, and this are also not detectable via the User Agent `navigator.userAgent` or the information inside the `navigator.userAgentData`.

My experiences with this matter is, that most of this kind of bots have a "Direct view" and less seconds "Visit duration".

To exclude this bots, a filter rule with user setted settings is needed like.

Exclude Viewer with (example):
Direct View = true
Visit Duration < 10 seconds

```
// setting:
$tsp_filter_start_seconds = get_tsp_filter_start_seconds(); // example: 10 seconds
$tsp_filter_direct_view = get_tsp_filter_direct_view(); // example: true

$view_visit_duration = get_view_visit_duration(); // example: 5 seconds

$track_bool = true;

if (($tsp_filter_direct_view === true) && ($view_visit_duration < $tsp_filter_start_seconds)) {
$track_bool = false;
}

if ($track_bool === true) {
// track the visit
} else {
// don't track the visit
// the example is here, because:
// direct view: true
// start seconds: 10
// visit duration: 5
}
```

Furthermore, expand this filter:

Exclude Viewer with (example):
Direct View = false / true
Referrer = Google / Bing / Wikipedia
Visit Duration < x seconds

So, if the referrer is "Google" and the Visit Duration is less than x seconds: dont' track.
This prevent tracking of speedy Website-Hopper (Google → Website[1] →back to Google → Website[2] →back to Google → Website[3] →back to Google ... ).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the issue's proposed direct-view, referrer, and visit-duration conditions, including the named get_tsp_filter_start_seconds() and get_tsp_filter_direct_view() settings. Trace how the plugin currently decides whether to track a visit. Done means configurable rules can exclude visits using the requested combinations without tracking them.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
analytics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.