Przeglądaj źródła

Add an option for Matomo Fix #991

Amauri CHAMPEAUX 2 lat temu
rodzic
commit
573b0fb0e1
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      tarteaucitron.services.js

+ 5 - 1
tarteaucitron.services.js

@@ -4424,7 +4424,11 @@ tarteaucitron.services.matomocloud = {
             this.setVisitorCookieTimeout(getOriginalVisitorCookieTimeout());
         }]);
 
-        tarteaucitron.addScript('https://cdn.matomo.cloud/matomo.js', '', '', true, 'defer', true);
+        if (tarteaucitron.user.matomoCustomJSPath === undefined) {
+            tarteaucitron.addScript('https://cdn.matomo.cloud/matomo.js', '', '', true, 'defer', true);
+        } else {
+            tarteaucitron.addScript(tarteaucitron.user.matomoCustomJSPath, '', '', true, 'defer', true);
+        }
 
         // waiting for Matomo to be ready to check first party cookies
         var interval = setInterval(function () {