-
-
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
Improved opt out #19528
Improved opt out #19528
Conversation
…o m-17452-opt-out-first-party # Conflicts: # plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js # plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js
@sgiehl I've haven't implemented the requirement that if the tracker cannot be found then detect if the user is logged into the Matomo dashboard and show an error on the webpage and log an application error. I'm not seeing a straightforward way to do this without trying to read Matomo session cookies and add new API calls to log errors, which seems like an overkill. Any suggestions? |
…o m-17452-opt-out-first-party
In case it's helpful for testing, this is the tracking page I used during development, it can load the tracker after a random delay (or not at all) and includes a URL string with all the parameters.
|
I guess I would have tried to solve that using the opt out code. The page, that includes the optout, fetches some javascript from Matomo, so in case the user is logged in you could simply add some more javascript code, that if |
That was my plan, but the optOutJS request in many cases is likely to be cross-site and therefore doesn't pass any Matomo session cookies (which are Without access to the Matomo API I suppose we could still use the tracking API to force some sort of tracking failure log (eg. |
Thanks for the feedback @tsteur and @sgiehl I've made the following changes:
The code should now be ready for further review. To document the various ways the opt-out can work, would it be better to add another section to this guide: https://developer.matomo.org/guides/tracking-javascript-guide#optional-creating-a-custom-opt-out-form or maybe the custom opt-out form guide and the new information about how the opt-out can work should be moved to a separate developer docs section? I can create draft updates of both these FAQs too: |
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.
Had a look through the code changes. Generally looks fine, but we should try to avoid adding style
attributes to elements where possible. Otherwise it won't be easily possible for themes to changes those elements. Would be better to either reuse existing css classes if possible or to add new classes if needed.
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.
Left a minor comment, we can also apply after hat one has been merged.
Otherwise this now looks good. So if @tsteur doesn't have any further objections, this should be good to merge.
plugins/PrivacyManager/changes.json
Outdated
{ | ||
"title": "Privacy Manager - User Opt-Out Improvements", | ||
"description": "The privacy manager user opt-out has been updated to provide new code generation options that improve compatibility and allow additional customisation.", | ||
"version": "4.12.0" |
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.
If we plan to write some kind of documentation around the new opt out, we could include the link here.
…o m-17452-opt-out-first-party
Description:
Fixes #17452
This is PR contains the UI changes to allow a choice between the tracker opt-out and the self-contained opt-out.
The self-contained code is ~85 lines and this contains a small 'MatomoConsent' class to handle basic checking, reading and writing of the consent cookie. All settings, including single language translations, are passed in as an object so they are easily editable at the top of the code block.
The 'MatomoConsent' class is reused the fallback method for the tracker opt out JavaScript to set cookies directly should the Matomo tracker be unavailable.
The tracker opt-out supports the following URL parameters and is compatible with the existing iFrame opt-out URL (just change
optOut
tooptOutJS
and add the div) :Review