X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/19d62168607b8a355156b2c2e089b615ab4c9381..01cbc40ed62f006398bcce62fc1f449b432b59b1:/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();