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

@ -304,6 +304,22 @@
//]]> //]]>
</script> </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} {ifset bodyScripts}
{include bodyScripts} {include bodyScripts}
{/ifset} {/ifset}

View file

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