]> git.openstreetmap.org Git - rails.git/commitdiff
Allow matomo cookie timeouts to be configured
authorTom Hughes <tom@compton.nu>
Thu, 8 Dec 2022 22:24:22 +0000 (22:24 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 8 Dec 2022 22:29:08 +0000 (22:29 +0000)
app/assets/javascripts/matomo.js

index f259b135808c1ff0f9760636b5605f27ded9f7a6..a48d9477d90a2c36516989f88af0e871a5ed58fa 100644 (file)
@@ -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();