Browse Source

Remove piwik

The _paq var need to be in the main scope, not possible with this
script.
Amauri CHAMPEAUX 10 years ago
parent
commit
257ba24255
1 changed files with 3 additions and 38 deletions
  1. 3 38
      tarteaucitron.services.js

+ 3 - 38
tarteaucitron.services.js

@@ -1,42 +1,5 @@
 /*global tarteaucitron, ga, Shareaholic, stLight*/
 
-// piwik
-tarteaucitron.services.piwik = {
-    "key": "piwik",
-    "type": "analytics",
-    "name": "Piwik",
-    "uri": "http://piwik.org/privacy/",
-    "needConsent": false,
-    "js": function () {
-        "use strict";
-        if (tarteaucitron.user.piwikServer === undefined ||
-                tarteaucitron.user.piwikSiteId === undefined) { return; }
-
-        var _paq = _paq || [];
-        _paq.push([function () {
-            var self = this;
-            function getOriginalVisitorCookieTimeout() {
-                var now = new Date(),
-                    nowTs = Math.round(now.getTime() / 1000),
-                    visitorInfo = self.getVisitorInfo(),
-                    createTs = parseInt(visitorInfo[2]),
-                    cookieTimeout = 33696000,
-                    originalTimeout = createTs + cookieTimeout - nowTs;
-                return originalTimeout;
-            }
-            this.setVisitorCookieTimeout(getOriginalVisitorCookieTimeout());
-        }]);
-        _paq.push(['trackPageView']);
-        _paq.push(['enableLinkTracking']);
-        _paq.push(['setTrackerUrl', tarteaucitron.user.piwikServer + 'piwik.php']);
-        _paq.push(['setSiteId', tarteaucitron.user.piwikSiteId]);
-        if (typeof tarteaucitron.user.analyticsMore() === 'function') {
-            tarteaucitron.user.piwikMore();
-        }
-        tarteaucitron.addScript('//' + tarteaucitron.user.piwikServer + '/piwik.js');
-    }
-};
-
 // disqus
 tarteaucitron.services.disqus = {
     "key": "disqus",
@@ -56,7 +19,9 @@ tarteaucitron.services.disqus = {
         "use strict";
         var id = 'disqus';
         
-        document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id);
+        if (document.getElementById('disqus_thread')) {
+            document.getElementById('disqus_thread').innerHTML = tarteaucitron.engage(id);
+        }
     }
 };