Connecting Matomo
You can connect a metrics collection service to your documentation portal. This allows you to see detailed analytics: who visited which article, from where, and whether they came from search or by direct link.
Matomo
Create a counter in Matomo first.
For a Docker-based portal
In Gramax docker-compose.yaml, add environment variables for this counter:
MATOMO_SITE_ID— Site ID inMatomo. Optional ifMATOMO_CONTAINER_URLis set.MATOMO_URL— URL of theMatomoinstance. Required ifMATOMO_SITE_IDis used. Example:https://matomo.gram.axorhttps://metrics.gram.ax/matomo.MATOMO_CONTAINER_URL— URL of theMatomocontainer. Optional. Learn more.Can be absolute (if
MATOMO_URLis not set). Example:https://matomo.gram.axorhttps://metrics.gram.ax/matomo.Can be relative (if
MATOMO_URLis set). Example:/or/metrics/matomo.
Restart
docker-compose.yaml.
For a static site
Before building, set the same variables as for the Docker-based portal above. Or configure them in the configuration file:
build: metrics: matomo: matomoSiteId: 1 matomoUrl: 'https://example.com/matomo' matomoContainerUrl: 'https://example.com/container'Build the site.
Yandex Metrica
Copy the counter number.
For a Docker-based portal
In Gramax docker-compose.yaml, add this environment variable for the counter:
YANDEX_METRIC_COUNTER:{meter number}.Restart
docker-compose.yaml.
For a static site
Before building, set
YANDEX_METRIC_COUNTER:{meter number}.Or configure it in the configuration file:
build: metrics: yandex: metricCounter: 12345678Build the site.