Based on Debian 10 "Buster" environment.

Matomo

Matomo, formerly Piwik, is an access analysis software. This can capture the visitor information with small javascript.
In case javascript can't be implemented, a small picture file or Nginx log can be used instead.

Matomo provides the cloud service as well as On-Premise installation. Cloud service will cost a little but you can outsource the Matomo maintenance.
Here I write the case with On-Premise installation for unlimited control.
Since Matomo official documentation explains everything, here I describe only small tips or additional information.


Installation

Matomo installation

When installing to the server, the alternative way described in the document is the easiest.

$ wget https://builds.matomo.org/matomo.zip && unzip matomo.zip
# chown www-data:www-data matomo

When you just open Matomo web installation, the install will show the bunch of commands starting from "chown www-data:www-data..." Actually, the first line of recursive ownership change should be enough.

Nginx configuration

Since Matomo is written in PHP, please refer to the PHP enabled configuration in the Nginx page.


Matomo setup

After Matomo and Nginx configured, Matomo web installer will be ready on the URL. There is nothing to add other than the installer screens or documentations.