Uploaded image for project: 'Zanata'
  1. ZNTA-1386

Piwik insertion code is outdated, slows page loading

    Details

    • Type: Bug
    • Status: Closed (View workflow)
    • Priority: unspecified
    • Resolution: Ready for Release
    • Affects Version/s: server-3.9.5, platform-4.0.0
    • Fix Version/s: server-3.9.6
    • Component/s: Performance
    • Labels:
      None
    • Tested Version/s:
      None
    • Sprint:
      16.20, 16.19
    • Story Points:
      2

      Description

      The current code for piwik (in WEB-INF/template/scripts.xhtml) is outdated, and causes browser warnings like this one (thus breaking our tests):

      WARNING: 06:23:16.556 http://localhost:48830/zanata/?dswid=-9554 109:16 A Parser-blocking, cross-origin script, http://example.com/piwik/piwik.js, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity.

      This seems to be the current tracking code:

      <!-- Piwik -->
      <script type="text/javascript">
      var _paq = _paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
      var u="//stats.example.com/piwik/";
      _paq.push(['setTrackerUrl', u+'piwik.php']);
      _paq.push(['setSiteId', ${piwikIdSite}]);
      var d=document, g=d.createElement('script'),
      s=d.getElementsByTagName('script')[0];
      g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js';
      s.parentNode.insertBefore(g,s);
      })();
      </script>
      <noscript><p><img src="//stats.example.com/piwik/piwik.php?idsite=${piwikIdSite}"
      style="border:0;" alt="" /></p></noscript>
      <!-- End Piwik Code -->
      
      
      <!-- Piwik Image Tracker-->
      <img src="https://stats.example.com/piwik/piwik.php?idsite=${piwikIdSite}&rec=1"
      style="border:0" alt="" />
      <!-- End Piwik -->
      

        Attachments

          Activity

            People

            • Assignee:
              sflanigan Sean Flanigan
              Reporter:
              sflanigan Sean Flanigan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: