It seems there are more and more people not wanting to rely on services provided by one of the internet giants because of data protection or legal issues. And one of the most essential services for a professional website is surely analytics.

The most prominent tool for website analytics comes from Google and it is widely used. As CMS vendor with a “best of breed” approach Magnolia provides modules for the integration of Google Analytics and Magnolia.

In the open source world, Matomo (formerly known as “Piwik”) seems to be the most successful contender to Google Analytics and there seems to be increased interest in using it in conjunction with Magnolia.

At the moment, there is no specific Magnolia module for Matomo (yet), but it’s rather easy to connect Magnolia and Matomo by using the Marketing Tags module together with the Marketing Tags app.

Connect Magnolia CMS with your Matomo instance

In Magnolia AdminCentral, navigate to the Marketing Tags app and create a new entry for Matomo.

Edit the tag and enter the details for Matomo like if it also should be active on the author instance and where to inject the “tag” (JavaScript snippet) into your website templates.

You can also specify the URL of your Matomo dashboard so you can view it within Magnolia itself.

Template:

https://your-matomo-instance.com/index.php?module=Widgetize&action=iframe&moduleToWidgetize=Dashboard&actionToWidgetize=index&idSite=1&period=week&date=yesterday

Add the JavaScript snippet you get from Matomo in in the content section:

Finally select the web pages where the snippet should be injected:

Some more hints:

  • once configured, don’t forget to publish the newly created Matomo configuration, otherwise your public instances will not receive the Matomo tag
  • you need to operate Matomo with HTTPS when collecting data from a website also running with HTTPS

If you configured the dashboard, you can view it inside your author instance:

As you can see, it’s pretty straightforward to integrate snippets / tags into a website managed with Magnolia CMS. We didn’t have to touch a single template to integrate Matomo as analytics tool.

Additional resources