PHRAS-2997- #comment add matomo script

This commit is contained in:
Harrys Ravalomanana
2020-03-24 17:38:39 +04:00
parent 7508ed8f93
commit 7d2941146a
7 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
{% if app['conf'].get(['registry', 'general', 'matomo-url']) != '' %}
{% if app['conf'].get(['registry', 'general', 'matomo-id']) != '' %}
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{{ app['conf'].get(['registry', 'general', 'matomo-url']) }}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', {{ app['conf'].get(['registry', 'general', 'matomo-id']) }}]);
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>
<!-- End Matomo Code -->
{% endif %}
{% endif %}