-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Track AI Bots through our HTTP Tracking API #23725
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
base: 5.x-dev
Are you sure you want to change the base?
Conversation
308560f to
51d0da8
Compare
sgiehl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: We need to update the tracking documentation afterwards. I'll create a PR for that once this PR has an approval.
| Plugins[] = CustomDimensions | ||
| Plugins[] = JsTrackerInstallCheck | ||
| Plugins[] = FeatureFlags | ||
| Plugins[] = BotTracking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This will only enable the plugin for new installs by default. Once the plugin is feature complete we can consider to add an update script to also enabled it for existing installs automatically.
faaf930 to
16239a0
Compare
core/Tracker/BotRequestProcessor.php
Outdated
| * This is the first method called when processing a tracker request. | ||
| * | ||
| * Derived classes can use this method to manipulate a tracker request before the request | ||
| * is handled. Plugins could change the URL, add custom variables, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * This is the first method called when processing a tracker request. | |
| * | |
| * Derived classes can use this method to manipulate a tracker request before the request | |
| * is handled. Plugins could change the URL, add custom variables, etc. | |
| * This method is called last. | |
| * | |
| * Derived classes should use this method to insert log data. |
Or something like that to document this is for writing, and not for manipulation/filtering.
| * @param Date $date Delete records older than this date | ||
| * @return int Number of deleted records | ||
| */ | ||
| public function deleteOldRecords(Date $date): int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also (right now that is) need a way to delete data for a site? Like a new PrivacyManager.deleteDataForDeletedSites event we can hook onto because a LogTable won't work?
Or can we delay that a for a little while?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think log data removal for deleted sites might work by implementing a LogTable. Didn't hink of this case. For removal by date that didn't work as it first looks up all visit and then iterates over the logtables that have a visitid column, which isn't the case here. I'll see if I can add a LogTable class and an according test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. It doesn't work aswell, as it still tries to check how the table can be join with log_visit. So a LogTable remains useless for now. Will add a new event for it
|
|
||
| $idRequest = $this->dao->insert($data); | ||
|
|
||
| Common::printDebug('Bot request recorded: idrequest=' . $idRequest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should replace that with a DI injected LoggerInterface.
…no longer called with Matomo 6
Expanded the documentation on bot tracking capabilities and parameters in Matomo, including details on request processing modes and specific parameters evaluated during bot tracking introduced with matomo-org/matomo#23725
Description:
Review