From: Tom Hughes Date: Thu, 8 Dec 2022 22:24:22 +0000 (+0000) Subject: Allow matomo cookie timeouts to be configured X-Git-Tag: live~1512 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/f20b250ba97e5330d83fc2fdd421f0bbcb4aacba?ds=sidebyside Allow matomo cookie timeouts to be configured --- diff --git a/app/assets/javascripts/matomo.js b/app/assets/javascripts/matomo.js index f259b1358..a48d9477d 100644 --- a/app/assets/javascripts/matomo.js +++ b/app/assets/javascripts/matomo.js @@ -14,6 +14,18 @@ if (OSM.MATOMO) { 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.trackPageView(); matomoTracker.enableLinkTracking();