Add matomo analytics too

This commit is contained in:
Celestora 2022-03-29 12:32:03 +03:00
parent f3009d71e7
commit 91cf2dcbba
2 changed files with 20 additions and 0 deletions

View file

@ -303,6 +303,22 @@
})(window,document,{$piwik->layer}, {$piwik->site});
//]]>
</script>
<script n:if="OPENVK_ROOT_CONF['openvk']['telemetry']['matomo']['enable']">
{var $matomo = (object) OPENVK_ROOT_CONF['openvk']['telemetry']['matomo']}
//<![CDATA[
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//" + {$matomo->container} + "/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', {$matomo->site}]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
//]]>
</script>
{ifset bodyScripts}
{include bodyScripts}

View file

@ -71,6 +71,10 @@ openvk:
container: ""
site: ""
layer: "dataLayer"
matomo:
enable: false
container: ""
site: ""
credentials:
smsc: