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
piwik.js: offer possibility to not send any tracking requests (similar to DoNotTrack) #9954
Comments
I will merge suggested fix soon but I will still leave the issue open. I'm merging it as it makes sense in general to check whether there is actually a request URL. This is a workaround though and won't be documented or officially supported. To fix the issue we should provide a method to actually disable any tracking. I'm kind of surprised we do not have such method yet :)
Goal of this issue would be to introduce a new method that let's a user disable tracking. We could maybe have a method |
FYI: I updated the title |
@tsteur thanks for adding the check and I look forward to the proposed enhancements, should make things easier/simpler! |
BTW: I merged the other pull request so in next version it should at least work as expected for you |
Hi @denisbabineau a Pull request would be welcome to implement the new JS function 👍 |
@mattab I was going to create a PR for my original request (the simple check) but the YUICompressor version at the time was no longer available (I see you updated to 2.4.7 just today, so that's good), I didn't want to provide a possibly incompatible minified file. Ideally minified/binaries wouldn't be stored in source control with every commits but I'm sure the piwik project has a reason to be doing so, to each his own :-) |
Fyi: we do this because some users use Piwik from git: http://piwik.org/faq/how-to-install/faq_18271/ so it's good to have the minified piwik.js ready to use. |
@denisbabineau Hey - probably you've thought of this - but can you call set 'setTrackerUrl' as null or '' when the user disables tracking; and then set it properly again if they (re)enable tracking? |
This was implemented in the meantime with the "Asking for consent" feature, see: https://developer.matomo.org/guides/tracking-javascript-guide#asking-for-consent 👍 |
I'm using piwik in a cordova application; I want to be able to enable/disable piwik tracking "at runtime" as per user request (thru UI opt-out). I cannot use
setDoNotTrack
since I can't override the navigator's properties and can't find other means to disable once initialized so I'm usingsetCustomRequestProcessing
to return anundefined
(empty) request when I don't want tracking to be sent. This works well for single requests going thrusendRequest
butsendBulkRequest
doesn't employ the same checks and causes invalid tracking information to be sent (you'll see things like[?], [?], ...
in your browser requests to piwik endpoint):vs:
The later only checks for empty arrays, not arrays with empty request. Recommend adding check before adding to array in
buildContentImpressionsRequests
:The text was updated successfully, but these errors were encountered: