From f20b250ba97e5330d83fc2fdd421f0bbcb4aacba Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 8 Dec 2022 22:24:22 +0000 Subject: [PATCH] Allow matomo cookie timeouts to be configured --- app/assets/javascripts/matomo.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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(); -- 2.39.5