Skip to content

Add Filter to Exclude Visits With More Than N Actions #386

Description

@Chardonneaur

Hi Team,

Description:
Some Matomo end users rely heavily on the import_logs.py feature to populate their analytics data. A recurring problem is the presence of bot traffic or abnormal visits that generate a large number of actions (page views, events, downloads, etc.) in a single session. These visits skew analytics and increase hit-based database.

Problem Statement:
Currently, there is no way to exclude visits that exceed a certain number of actions during the import process. Bot traffic often shows up as visits with unusually high activity levels.

Feature Request:
Introduce a new parameter to import_logs.py that allows users to define a maximum number of actions per visit. Visits with more than n actions should be ignored during import. This should support:

  • A customizable integer threshold (e.g., --max-actions-per-visit=10)
  • Application across all types of actions
  • Ideally combined with other filters (e.g., URL pattern or user agent exclusions)

Expected Outcome:
This feature will help:

  • Reduce bot traffic by filtering out high-action visits
  • Improve the quality and trustworthiness of imported data
  • Lower the number of hits being charged to customers by excluding unwanted activity

Who Asked For It:
Matomo end users concerned about bots and inflated hit counts due to automated visits with high activity levels.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions