Imagine that you are a web hosting company with a few hundred customers. Many web hosts would like to offer modern, beautiful, powerful, Free/Libre web analytics to their customers. This is easy to do with Matomo (Piwik). This tutorial explain how to use the Log Analytics script to provide Web Analytics reports to your customers.

How to setup Log File Analytics with Matomo (Piwik) for a Web Hosting Company?

  1. install Matomo (Piwik) on a powerful dedicated server, rotate all web server logs to a centralized log server.
  2. run the Matomo (Piwik) import script daily soon after midnight to import all of the logs from the day before
    • the script can run with
      --add-sites-new-hosts

      to automatically add new websites to Matomo for new hostnames not yet known to Matomo

    • or you can run using
      --idsite-fallback

      to record log lines with an “unknown” URL hostname to a specific catch-all website in Matomo (Piwik)

  3. using the Matomo (Piwik) API, you can a) create a new user and b) assign permissions for this user to view one or several websites. Using the Manage Users API, this would be as easy as 2 HTTP requests.
    • Typically, a developer or sysadmin at your company would make this change in your existing customer signup workflow to add these few http requests
    • the same user can have access to several websites in Matomo (Piwik) and we recommend that you use this feature to make sure all your customers access all of their websites’ statistics under one account. And don’t forget, you can enjoy the All Websites Dashboard quick view of all of their websites
  4. at this point, your users should be able to access Matomo (Piwik) reports for their own websites and enjoy all of Matomo’s great functionality
  5. as an extra step, you could, for example, create a custom PDF or HTML report sent daily/weekly/monthly to your customers.
    The report could use your company logo and include only the reports you specified when creating the report (check the Scheduled Reports API Doc)

All these steps can be easily automated with the powerful Matomo (Piwik) APIs: you would never have to login and administrate Matomo directly.

If you have more suggestions or other use cases to submit for this page, please let us know!

If you are using Matomo (Piwik) in your company and it saves you thousands of dollars in licenses, please consider making a donation to the team or sponsoring a new feature. We rely on our partners and supporters for ongoing Matomo development.

Any questions?

Many answers and more information about Matomo you can find here:

We are social

Follow us: