X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/12c1d5e6c05813a0697724277b4d8529a1a7c240..0d2010cd2fb3e6b012a03e974511603b062df59e:/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();