X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e443ec7587e78564deadd34f0aebde02c83437cc..032f6f9870c5c3f71582f90d6bf22ec68a74848e:/app/assets/javascripts/matomo.js diff --git a/app/assets/javascripts/matomo.js b/app/assets/javascripts/matomo.js index 34af54ce7..7d147a55c 100644 --- a/app/assets/javascripts/matomo.js +++ b/app/assets/javascripts/matomo.js @@ -10,10 +10,23 @@ if (OSM.MATOMO) { success: function () { matomoTracker = Matomo.getTracker(base + "matomo.php", OSM.MATOMO.site); - if (OSM.user) { + if (OSM.user && OSM.MATOMO.set_user) { matomoTracker.setUserId(OSM.user.toString()); } + if (OSM.MATOMO.visitor_cookie_timeout) { + matomoTracker.setVisitorCookieTimeout(OSM.MATOMO.visitor_cookie_timeout); + } + + if (OSM.MATOMO.referral_cookie_timeout) { + matomoTracker.setReferralCookieTimeout(OSM.MATOMO.referral_cookie_timeout); + } + + if (OSM.MATOMO.session_cookie_timeout) { + matomoTracker.setSessionCookieTimeout(OSM.MATOMO.session_cookie_timeout); + } + + matomoTracker.setSecureCookie(true); matomoTracker.trackPageView(); matomoTracker.enableLinkTracking();