X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6b696558126fdeaefab37291a3bd26136c95fddb..e6395508c41d8eebd0dabe897b7043686250b0d5:/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();