matomo环境

  • center7.9
  • php7.4.0
  • nginx1.15
  • mysql5.7
  • 域名需要https
  • matomo最新版

matomo安装

matomo使用

  • 统计使用
  • 找到ALL Websites--》Add a new website,创建新网站统计,找到JavaScript Tracking Code
  • 把以下代码放到你网站​</head> 标签前
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//matomo.xxxx.com/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->