Add Matomo without consent
This commit is contained in:
parent
306717f36d
commit
34e4a22294
|
|
@ -2279,7 +2279,7 @@ tarteaucitron.services.matomo = {
|
||||||
"type": "analytic",
|
"type": "analytic",
|
||||||
"name": "Matomo (formerly known as Piwik)",
|
"name": "Matomo (formerly known as Piwik)",
|
||||||
"uri": "https://matomo.org/faq/general/faq_146/",
|
"uri": "https://matomo.org/faq/general/faq_146/",
|
||||||
"needConsent": true,
|
"needConsent": false,
|
||||||
"cookies": ['_pk_ref', '_pk_cvar', '_pk_id', '_pk_ses', '_pk_hsr', 'piwik_ignore', '_pk_uid'],
|
"cookies": ['_pk_ref', '_pk_cvar', '_pk_id', '_pk_ses', '_pk_hsr', 'piwik_ignore', '_pk_uid'],
|
||||||
"js": function () {
|
"js": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
@ -2294,6 +2294,19 @@ tarteaucitron.services.matomo = {
|
||||||
window._paq.push(["trackPageView"]);
|
window._paq.push(["trackPageView"]);
|
||||||
window._paq.push(["setIgnoreClasses", ["no-tracking", "colorbox"]]);
|
window._paq.push(["setIgnoreClasses", ["no-tracking", "colorbox"]]);
|
||||||
window._paq.push(["enableLinkTracking"]);
|
window._paq.push(["enableLinkTracking"]);
|
||||||
|
window._paq.push([function() {
|
||||||
|
var self = this;
|
||||||
|
function getOriginalVisitorCookieTimeout() {
|
||||||
|
var now = new Date(),
|
||||||
|
nowTs = Math.round(now.getTime() / 1000),
|
||||||
|
visitorInfo = self.getVisitorInfo();
|
||||||
|
var createTs = parseInt(visitorInfo[2]);
|
||||||
|
var cookieTimeout = 33696000; // 13 mois en secondes
|
||||||
|
var originalTimeout = createTs + cookieTimeout - nowTs;
|
||||||
|
return originalTimeout;
|
||||||
|
}
|
||||||
|
this.setVisitorCookieTimeout( getOriginalVisitorCookieTimeout() );
|
||||||
|
}]);
|
||||||
|
|
||||||
tarteaucitron.addScript(tarteaucitron.user.matomoHost + 'piwik.js', '', '', true, 'defer', true);
|
tarteaucitron.addScript(tarteaucitron.user.matomoHost + 'piwik.js', '', '', true, 'defer', true);
|
||||||
}
|
}
|
||||||
|
|
@ -2325,4 +2338,3 @@ tarteaucitron.services.bingads = {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue