# Matomo

Integration with Matomo has been introduced to gather and assess data regarding website traffic.

Matomo Analytics serves as an open-source web analytics solution, offering extensive insights into the usage of websites or applications. With a wide range of tools and features, it allows for tracking, analyzing, and reporting on visitor behavior and engagement. Matomo is specifically designed to prioritize user privacy and data ownership.

# Configuration

Enable the integration and click the "Configure" button to proceed. You will be directed to a form where you will find a URL that needs to be accessed to reach the Matomo platform. Please note that the URL displayed below is provided as an example, and the "//admin.panelalpha.com/" portion will vary for each installation.

Proceed to the provided URL.

# Installation

In case your Matomo is not installed yet:

  1. A "Welcome" page will appear. Start the installation by pressing the "Next" button.

  2. Start the installation with the system check. If everything is fine, you may proceed to the next step.

  3. Database setup - the data are automatically fetched from your system, you do not have to change anything at this point. Press "Next" to continue.

  4. Creating the tables - tables are created automatically, once ready, press "Next" to continue.

  5. Create a superuser account. The entered here data will be used for logging into Matomo.

  6. Set up a website - at this point you are creating the first website added to Matomo.

  7. JavaScript Tracking Code - skip this step.

  8. Congratulations, your Matomo installation is now ready. Press the Continue To Matomo button. You will be redirected to the login window.

# Log into Matomo

  1. Use the superuser credentials to log in (see point 5).

  2. You will be moved to dashboard once you are successfully logged in. Proceed to Administration → Personal → Security.
    There press "Create New Token" button and provide a short description, confirm.

  3. Your API Token will be immediately generated. Copy it and keep safe as you will need it soon in your PanelAlpha configuration.

  4. Go back to your PanelAlpha → Configuration → Integrations → Matomo. Paste the just generated token in the API Token field. Press "Update" to complete the configuration.

# Additional Information

  1. If you encounter any problems when accessing the configured Matomo address, you will need to modify the following file:
/opt/panelalpha/app/packages/matomo/config/global.ini.php 
  • Open that file and set the enable_trusted_host_check variable to 0 as in example below:
   enable_trusted_host_check = 0 
  • Alternatively, add the following line:
  trusted_hosts[] = "IP_ADDRESS:PORT" 

Remember to replace IP_ADDRESS with the server IP, and PORT with the port with the configured Matomo (the default port is 8079).

  1. If necessary, you can initiate a password reset procedure through the command line at any time:
  • Access your server where PanelAlpha application is installed, using SSH with root privileges
  • Use the following bash command:
(PASSWDHASH=`docker compose -f /opt/panelalpha/app/docker-compose.yml exec \
   matomo php -r 'echo password_hash(md5("YOUR_NEW_PASSWORD"), PASSWORD_DEFAULT);'` \
   && docker compose -f /opt/panelalpha/app/docker-compose.yml \
   exec database-matomo mysql -u"matomo" \
   -p"$(grep ^MATOMO_MYSQL_PASSWORD= /opt/panelalpha/app/.env | cut -d '=' -f2-)" \
   matomo -e "UPDATE matomo_user SET password = \
   '`echo $PASSWDHASH`' WHERE email = 'YOUR_EMAIL_ADDRESS'")

Please remember to replace YOUR_NEW_PASSWORD and YOUR_EMAIL_ADDRESS with correct values.