Detect consent managers on the selected site and show a setup link #19794
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR adds a new 'challenge' to the 'Become a Matomo Expert' widget which is part of the Tour plugin. It will check for popular consent managers installed on the currently selected site and if detected will show a link to an FAQ showing how to integrate them with Matomo. Additionally it will check to see if the integration code is present on the website and if so automatically mark the challenge as complete.
A bit more detail:
When the Challenge object is constructed it will perform a simple cURL request to grab the current site main URL into a string and then check this against a known list of consent manager identifiers.
There are three possible outcomes:
The known consent managers are stored in a assoc array with detection strings and the URL for the guide, this can easily be extended in the future to cover more consent managers.
Currently supported: Osano, Cookiebot, CookieYes, Tarte au Citron, Klaro and Complianz GDPR for WordPress.
The linked guides are not public yet, but the included URLs will point to the correct location when they published.
One issue to consider is that this will cause a page load hit to the tracked website every time the widget is loaded. We could possibly soften this by adding a 'last checked' timestamp somewhere to ensure that we never check more frequently than say every 5 minutes. Another tweak could be to set the last checked timestamp a week(?) into the future if either no consent manager is detected or the consent manager is detected and is connected. Additionally we might want the cURL page load to use a user agent that avoids tracking or at least identifies as a robot of some sort.
Thoughts on this much appreciated!
Ref: DEV-3004
Review