Skip to content

Latest commit

 

History

History
130 lines (107 loc) · 4.38 KB

matomo.md

File metadata and controls

130 lines (107 loc) · 4.38 KB

Useful links:

Download docker-compose files

wget https://raw.githubusercontent.com/matomo-org/docker/master/.examples/apache/db.env
wget https://raw.githubusercontent.com/matomo-org/docker/master/.examples/apache/docker-compose.yml

start containers

docker-compose up

Containers start/stop

start containers

docker-compose up

stop containers

docker-compose down

remove volumes

docker volume ls
docker volume rm apache_matomo
docker volume rm apache_db

Matomo installation

  • go to installation page http://127.0.0.1:8080/

  • Database Setup:

    Password: matomo

  • Super User

    Super user login: admin Password: adminadmin Password (repeat): adminadmin Email: [email protected]

  • website

    Website name: localhost-matomo Website url: http://127.0.0.1:8080

  • for removing Warning about differences in configuration and real host running:

docker exec -it apache_app_1 /bin/bash
sed --in-place 's/\[General\]/\[General\]\nenable_trusted_host_check=0/g' /var/www/html/config/config.ini.php
  • debug messages during request:
# request to remote resource
x-www-browser http://127.0.0.1:8080/matomo.php?idsite=3&rec=1

# create property block 
sed --in-place 's/\[TagManager\]/\[TagManager\]\n\n\[Tracker\]\ndebug=1/g' /var/www/html/config/config.ini.php

# deactivate element in the block
sed --in-place 's/debug = 1/debug = 0/g' /var/www/html/config/config.ini.php
# activate element in the block
sed --in-place 's/debug = 0/debug = 1/g' /var/www/html/config/config.ini.php

In Chrome will not work due default DNT

http://127.0.0.1:8080/matomo.php?idsite=4&rec=1
# Settings->Privacy->Users opt-out->Support Do Not Track preference-> Disable ( not recommended )

**need to de-activate **

  • additional parameters - show full stack trace
docker exec -it apache_app_1 /bin/bash
# activate
sed --in-place  "s/define('PIWIK_PRINT_ERROR_BACKTRACE', false);/define('PIWIK_PRINT_ERROR_BACKTRACE', true);/g" /var/www/html/index.php

# deactivate
sed --in-place  "s/define('PIWIK_PRINT_ERROR_BACKTRACE', true);/define('PIWIK_PRINT_ERROR_BACKTRACE', false);/g" /var/www/html/index.php
  • simple visit trace:
http://127.0.0.1:8080/matomo.php?idsite=3&rec=1

server: db username: matomo password: matomo database: matomo

// scope: page: matomo_log_link_visit_action
// scope: visit: matomo_log_visit
var _paq = window._paq = window._paq || [];
_paq.push(['setCustomVariable',1,"user-id","13,14,15,16","page"]);

start apache for writing first html page with code

docker rm apache
docker run --name apache -v $(pwd):/app -p 7070:8080 bitnami/apache:latest
select * from matomo_log_visit --  contains one entry per visit (returning visitor)
select * from matomo_log_action --  contains all the type of actions possible on the website (e.g. unique URLs, page titles, download URLs…)
select * from matomo_log_link_visit_action --  contains one entry per action of a visitor (page view, …)
select * from matomo_log_conversion --  contains conversions (actions that match goals) that happen during a visit
select * from matomo_log_conversion_item --  contains e-commerce conversion items