- $data['endofpage'][] = '<!-- Piwik -->' .
-'<script type="text/javascript">' .
-' var _paq = _paq || [];' .
-' _paq.push([\'trackPageView\']);' .
-' _paq.push([\'enableLinkTracking\']);' .
-' (function() {' .
-' var u="//' . $piwikUrl . '/";' .
-' _paq.push([\'setTrackerUrl\', u+\'piwik.php\']);' .
-' _paq.push([\'setSiteId\', \'' . $piwikSiteid . '\']);' .
-' 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="//' . $piwikUrl . '/piwik.php?idsite=' . $piwikSiteid . '" style="border:0;" alt="" /></p></noscript>' .
-'<!-- End Piwik Code -->';
+ $data['endofpage'][] = sprintf(
+ file_get_contents(PluginManager::$PLUGINS_PATH . '/piwik/piwik.html'),
+ $piwikUrl,
+ $piwikSiteid,
+ $piwikUrl,
+ $piwikSiteid
+ );