This an alternative of one of my previous post that talking about Setup Google Analytics to Modern SharePoint from any platform.
Google Analytics means your organization have to host data about softwares and users into a tierce solution. For some governance, privacy and security reasons, some organization can not use this kind of solutions.
So, what are the alternatives? Is there another free solution?
I did some research for a while ... I found other interesting analytics tools that I tried on my own blog and SharePoint test environments. Two solutions caught my attention based on the following criteria:
- Free: totally free is a must but at least basic features for free is a beginning
- Open-Source: I like so much the open-source solutions! that let the organization enough flexibilities to improve and customize the solution for their needs. And, incidentally, contribute to this project 🙂
- Self-Hosted: of course, if you want to keep an hand on the data, the better solution is the self-hosting. Thank to this kind of solution, you can potentially have a compliant GDPR solution too 😉
- Google Analytics alternative: currently is a reference in the world of web analytics service. So I took it as a reference, to found solutions that provide sufficient similar features like real time, several graph, create custom dashboards, maps, etc.
- Relatively easy to implement: if you go to present an awesome solution to your customer but he have to spend the half of his time and his budget to set up the solution itself... hmm, you know what I mean, isn't it? 😕
Open Web Analytics
I tested OWA at first because of several features available for free like heatmap, mouse click, etc.
After several weeks, I noted that the admin interface was really old, some features don't really work (for my part, I did not manage to make it work "heatmap" for example) and the real time is missing. In addition, I'm following the GitHub repository of the solution and I did not see any new fixing issue, enhancement or whatever since a long time ago...
For my tests, I used the https://github.com/vladk1m0/docker-owa docker image.
So, I decided to pass to next analytics tool...
Matomo is the solution that I am using currently since some weeks; this solution looks a lot like to Google Analytics:
- Dashboard configuration
- Tracker code implementation
- Features (available for free)
In addition to that, Matomo is:
- GDPR compliance
- Customizable (Open-Source)
- Marketplace of features
- A SPFx and Add-In available for SharePoint‼️(https://matomo.org/sharepoint-analytics/download/)
Moreover, I did a suggestion for a new dashboard widget on the GitHub repository and a member of the team answer me in the same day! Efficiency 🙂
So now, I'll show you how I have configured my environment...
Matomo for Modern SharePoint - for everybody
You can have Matomo Analytics in two ways:
- Cloud Hosting (the providing is not free. A grid of pricing is available here)
- Self-Hosted with installation (free - some technical knowledges are required)
See On-Premise/Cloud hosting comparison table for more information
Set up Docker Matomo server
Because I don't have several servers under the hand, I'm using Docker containers to have several services, included Matomo that provide a Docker Image that can be quickly configured and implemented into your environment.
- Docker Engine
- Docker Compose: https://docs.docker.com/compose/install/
My localhost Docker composer file
Here, an example of Docker compose that I'm using on my local host to perform tests:
version: '3.7' services: mysql: image: mysql:5.7.25 environment: - MYSQL_ROOT_PASSWORD=password01 restart: always phpmyadmin: image: phpmyadmin/phpmyadmin:latest depends_on: - mysql ports: - "9010:80" - "9011:443" environment: - PMA_HOST=mysql restart: always matomo: image: bitnami/matomo:latest depends_on: - mysql ports: - "9020:80" - "9021:443" environment: - MARIADB_HOST=mysql - MARIADB_ROOT_PASSWORD=password01 - MYSQL_CLIENT_CREATE_DATABASE_NAME=matomo - MYSQL_CLIENT_CREATE_DATABASE_USER=matomo - MYSQL_CLIENT_CREATE_DATABASE_PASSWORD=password01 - MATOMO_DATABASE_NAME=matomo - MATOMO_DATABASE_USER=matomo - MATOMO_DATABASE_PASSWORD=password01 - MATOMO_USERNAME=matomo - MATOMO_HOST=matomo - MATOMO_PASSWORD=password01 - [email protected] restart: always networks: default:
Save this content into a file
matomo-local-compose.yml and execute the following command on your Docker host:
docker-compose -f matomo-local-compose.yml up -d
After some seconds, you will can access to your Matomo server through your favorite browser via the URL http://localhost:9020 and the following credentials:
- login: matomo
- password: password01
Note: they are no data persistence. For more information:
Set up Matomo client (SharePoint Framework extension)
Yes, a SPFx extension is providing by Matomo exist but for developers, you can't edit, improve or adapt the solution... That is why I created my own solution and moreover a solution that can be provisionned quickly and easily.
I wrote two scripts that will allow you to implement the solution easily.
- Matomo Analytics Tracking Site Id
- Tenant App Catalog or Site Collection App Catalog:
- Configure your Tenant App Catalog: https://docs.microsoft.com/en-us/sharepoint/use-app-catalog
- Configure your Site Collection App Catalog (optional): https://docs.microsoft.com/en-us/sharepoint/dev/general-development/site-collection-app-catalog
- If you choose to use PowerShell solution, you'll need to install the PnP PowerShell module
- If you choose to use the any platform solution, you'll need Bash and Office365-CLI
PowerShell (Windows Only)
- Download the PowerShell solution from the repository
- Unzip the package
- From your PowerShell terminal, connect to your target site collection with
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/target-site
- Launch the
.\setup.ps1 -siteUrl https://contoso.sharepoint.com/sites/target-site -trackingUrl https://matomo.my-domain.com -trackingSiteId '2'
If you can't execute the PowerShell script, cause of security reason, before unzip the package, execute the
Note: in this example, the package is deploy to the Site Collection App Catalog. You have other options like illustrated into the README.md, that allow you to manage the deployment.
Any platform (Linux, MacOS, Windows)
- Download the any platform solution from the repository
- Unzip the package
chmod +x ./setup.sh
- From your Bash terminal, connect to your target site collection with
spo login https://contoso.sharepoint.com/sites/target-site
- Launch the
./setup.sh --siteUrl https://contoso.sharepoint.com/sites/target-site --trackingUrl https://matomo.my-domain.com --trackingSiteId '2'
Note: in this example, the package is deploy to the Site Collection App Catalog. You have other options like illustrated into the README.md, that allow you to manage the deployment
Pretty simple, isn't it ?
Hoping this post will help you 😉