-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Give plugins using isExcludedVisit hook more information #10415
Comments
I strongly support this change! As the parameters are past as array this should not break any existing code. This is really important as the plugins using the hook cannot reliably access any information related to the request. |
The first suggestion is sufficient for my needs but the second one gives far more information to the plugin. |
Hi @e-dschungel - @tillsteinbach @Thomas--F It sounds good to add a new parameter to the event. I propose to add Could you maybe submit a pull request for this improvement? |
Note: If you'd like this change in the next Piwik version 2.16.3 please submit the PR this week! |
It's not enough, just to add To pass all the given information, you can also add the parameter I've made a PR with all informations but there is a syntax error with one of the brackets behind |
@Thomas--F simply add a new commit to the branch the PR comes from. the PR will be automatically updated. |
OK, the second PR ist correct now. |
Sorry, I must be blind, but I cannot find the PR. What is the current state of this feature? |
Sorry, something went wrong. Now there ist finally a PR: |
* Fix depraction test: use assertDeprecatedMethodIsRemovedInPiwik3 * Fix Scheduled Reports sent one hour late in daylight saving timezones (#10443) * convert hour to send report to/from UTC, to ensure it isn't affected by daylight savings * adds update script to change existing scheduled reports to use utc time * code improvement * adds missing param * Added new event Archiving.makeNewArchiverObject to allow customising plugin archiving (#10366) * added hook to alllow plugin archiving prevention * cr code style notes * reworked PR to fit CR suggestions * added PHPDoc for hook * Event description more consistent * UI tests: minor changes * Comment out Visitor Log UI tests refs #10536 * Adds test checking if all screenshots are stored in lfs * removed screenshots not stored in lfs * readds screenshots to lfs * 2.16.3-b4 * Issue translation updates against 2.x-dev * language update * Fix bug in widget list remove where the JSON object becomes array * 2.16.3-rc1 * console command custom-piwik-js:update should work when directory is writable and file does not exist yet (#10576) * followup #10449 * Fix test (cherry picked from commit fac3d63) * Prevent chmod(): No such file or directory * Automatically update all marketplace plugins when updating Piwik (#10527) * update plugins and piwik at the same time * make sure plugins are updated with piwik * use only one try/catch * reload plugin information once it has been installed * make sure to clear caches after an update * fix ui tests * make sure to use correct php version without any extras * Additional informations passed in the hook "isExcludedVisit" (issue #10415) (#10564) * Additional informations passed in the hook "isExcludedVisit" (issue #10415) * Added better description to the new parameters * Update VisitExcluded.php * Remove two parameters not needed as better to use the Request object * Update VisitExcluded.php * remove extra two parameters in VisitExcluded constructor to prevent confusion (#10593) * Update our libs to latest #10526 * Update composer libraries to latest #10526 * Update log analytics to latest * When updating the config file failed (or when any other file is not writable...), the Updater (for core or plugins) will now automatically throw an error and cancel the update (#10423) * When updating the config file failed (or when any other file is not writable...), the Updater (for core or plugins) will now automatically throw an error and cancel the update * add integration test to check the correct exception is thrown when config not writabel * New integration test for updater * Make test better * When opening the visitor profile, do not apply the segment (#10533) * When opening the visitor profile, do not apply the segment * added ui test for profile but does work for me * next try to make ui test work * add expected screenshot * added missing doc
It would be nice if the hook isExcludedVisit would give more information the the plugins using it.
For example the Plugin BotTracker has no possibility to get the useragent when the log-import script with the --enable-bots options is used. So the Bottracker tables stay empty. Other plugins could use the additional information to make a better choice if the visit should be excluded or not.
The suggestion is to extend the hook with idSite or request and userAgent like this:
Piwik::postEvent('Tracker.isExcludedVisit', array(&$excluded, $this->idSite, $this->userAgent));
Piwik::postEvent('Tracker.isExcludedVisit', array(&$excluded, $this->request, $this->userAgent));
see the discussion at https://github.com/Thomas--F/BotTracker/issues/38 (in german)
The text was updated successfully, but these errors were encountered: