We're updating the issue view to help you get more done. 

Piwik insertion code is outdated, slows page loading

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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 <!-- 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 -->

Environment

None

Status

Assignee

Sean Flanigan

Reporter

Sean Flanigan

Tested Version/s

None

Story Points

2

Components

Sprint

None

Fix versions

Affects versions

server-3.9.5
platform-4.0.0

Priority

unspecified