Fix piwik missing slash problem

This commit is contained in:
Luc Didry 2015-06-19 23:19:30 +02:00
parent dc85aa79c8
commit f9d831bf8a

View File

@ -18,7 +18,7 @@
_gs('{{ $gosquaredTracking }}');
</script>
@endif
@if($piwikTracking = Setting::get('app_analytics_pi_url'))
@if($piwikTracking = rtrim(Setting::get('app_analytics_pi_url'), '/'))
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
@ -26,10 +26,10 @@
_paq.push(['enableLinkTracking']);
(function() {
var u="//{{ $piwikTracking }}";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setTrackerUrl', u+'/piwik.php']);
_paq.push(['setSiteId', {{ Setting::get('app_analytics_pi_siteid', 1) }}]);
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);
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="//{{ $piwikTracking }}/piwik.php?idsite={{ Setting::get('app_analytics_pi_siteid', 1) }}" style="border:0;" alt="" /></p></noscript>