A few features are missing in this theme component. Such as do-not-track and cookie settings. To be GDPR compliant without cookie consent it’s needed to make sure tracking cookies are disabled and people have the means to opt-out tracking.
For that the following parts need to be included:
_paq.push(['setDoNotTrack', true]);
_paq.push(['disableCookies']);
Or is this plugin working in a different way? Just assuming since I don’t see it here and also not when I search for donottrack
in that repo.
<script type="text/discourse-plugin" version="0.2">
api.onPageChange((url, title) => {
const currentUser = api.getCurrentUser();
if (settings.exclude_groups.trim() && currentUser) {
const excludedGroups = settings.exclude_groups.split(",").map(g => g.trim());
const currentUserGroups = currentUser.groups.map(g => g.name);
if (excludedGroups.filter(g => currentUserGroups.includes(g)).length) {
return;
}
}
window._paq = window._paq || [];
window._paq_loaded = window._paq_loaded || false;
if (!_paq_loaded) {
var u = `//${settings.host_url}/`;
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', settings.website_id]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
This file has been truncated. show original
The Matomo web interface also lets you add these 2 paq lines easily. Maybe add these options to the Discourse plugin for easy configuration?
Will test this commit, if it works well I’ll submit a PR.
<script type="text/discourse-plugin" version="0.2">
api.onPageChange((url, title) => {
const currentUser = api.getCurrentUser();
if (settings.exclude_groups.trim() && currentUser) {
const excludedGroups = settings.exclude_groups.split(",").map(g => g.trim());
const currentUserGroups = currentUser.groups.map(g => g.name);
if (excludedGroups.filter(g => currentUserGroups.includes(g)).length) {
return;
}
}
window._paq = window._paq || [];
window._paq_loaded = window._paq_loaded || false;
if (!_paq_loaded) {
var u = `//${settings.host_url}/`;
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', settings.website_id]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
This file has been truncated. show original
2 Likes