Is Matomo compatible with Microsoft SharePoint Online (O365 Analytics) and/or SharePoint On-Premises farms?
Yes you can use Matomo Analytics for your SharePoint sites and learn more about the productivity of your employees and overall user engagement.
Important note: The links below contain information and resources that are neither maintained nor endorsed by the Matomo Team. The use of third party extensions is at your own risk.
1) If you’re using SharePoint Modern experience (SharePoint Online – Office 365, or SharePoint Server 2019)…
The modern experience is designed to be compelling, flexible, mobile, and easier to use. It is available in SharePoint Online in Office 365. Some modern experiences are available with SharePoint Server 2019 (On-Premise).
To measure your SharePoint Modern sites with Matomo, follow the steps explained in this guide for modern SharePoint Pages.
2) If you’re using Classic SharePoint sites…
To measure your SharePoint Classic site collections with Matomo, follow the steps in this article: Setup Matomo Analytics to the classic SharePoint site collections. The solution involves running this Powershell script that will automatically add the Matomo Tracking code to your pages.
3) If the above solutions don’t work…
If the solutions above don’t work, we recommend to leave a comment in the comments of the articles that are linked to.
If you’re using older versions of SharePoint On-Premise such as SharePoint 2013 farm, you can try follow this (usually not recommended) solution to include Matomo JavaScript Tracking code in your SharePoint 2013 (intranet) Sites. The solution involves adding the Matomo JavaScript tracking code to your Master pages in SharePoint 2013.
a) Get the tracking code for your website
- log in to Matomo (Piwik) with your admin or Super User account
- click on your username in the top right menu, and click Settings to access the administration area
- click on Tracking Code in the left menu
- Copy the Tracking code
The tracking code looks as follows:
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{$MATOMO_URL}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', {$IDSITE}]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
In your tracking code, {$MATOMO_URL}
would be replaced by your Matomo URL and {$IDSITE}
would be replaced by the idsite of the website you are tracking in Matomo.
b) Add this Tracking code to SharePoint master page.
- Edit your master page in ‘Advanced mode’ with SharePoint designer 2013
- and paste/insert the Matomo Tracking code just before
</head>
tag. - Save-Check-in-publish/Approve the master page.
c) Check your Visitors data in Matomo
Under Visitors > Visits Log, select “Today” in the calendar, you can now see your visitors and interactions tracked in real-time.
Using Matomo Tag Manager with SharePoint
See our FAQ How do I use the Matomo Tag Manager with SharePoint?