Piwik insertion code is outdated, slows page loading
Description
Environment
None
Activity
Show:
Former user 14 September 2016 at 05:51
To implement:
Data migration to strip off the http: and https: to leave the URLs to start with //
Replace piwik script with the current tracking code (shown in the description)
Change the validator for the piwik server URL
Ready for Release
Details
Details
Assignee
Sean Flanigan
Sean FlaniganReporter
Sean Flanigan
Sean FlaniganTested Version/s
None
Story Points
2
Components
Sprint
None
Fix versions
Affects versions
Priority

More fields
Time tracking
More fields
Time trackingCreated 13 September 2016 at 07:55
Updated 27 June 2018 at 02:21
Resolved 30 September 2016 at 03:50
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=-9554109: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 -->