XWiki Analytics Extensions

05 Dec 2019 5 min read
Written by Oana Elena Florea, Customer Support Manager

The article has been updated on the 3rd of April, 2023 to cover the compatibility with Google Analytics 4 as well.

It's essential to understand who is visiting your website, how they're using it, and what they're looking for. Analytics extensions and tools help you to grasp customers that you usually don't know existed. Visitors that come to your site, and don't interact with your content, have an apparent reason to leave your site empty-handed.

Just as you'd be doing market research to understand why customers say no to your company in person or leave your retail store without purchasing, you need to know what your online customers have to say. Their feedbacks and actions can be more insightful than you can imagine. All the hints for website improvement and UX enhancement lie in their actions.

What data do the most popular XWiki Analytics extensions collect?

Analytics tools are powerful business and marketing platforms for websites. They include features like tracking down the content most accessed by users, observe their general behavior on the website, measure traffic, audience, goals, etc.

The most used analytics tools with XWiki are Google Analytics and Matomo (Open Source alternative to Google Analytics, formerly named Piwik). Both can be configured to work with the GDPR Cookie Consent application to allow users to opt-out from being tracked. While Google Analytics can be connected via HTML code, for Matomo a server needs to be installed on-premise to follow up on the promise to “take back control on data ownership and user privacy protection”1.

When using Google Analytics with XWiki, the pageview tracking information is collected from the wiki. Google also uses all their services to aggregate the information displayed with Analytics: “We collect information to provide better services to all our users — from figuring out basic stuff like which language you speak, to more complex things like which ads you’ll find most useful, the people who matter most to you online, or which YouTube videos you might like. The information Google collects, and how that information is used, depends on how you use our services and how you manage your privacy controls.2

When using the Matomo extension with XWiki the following information will be tracked from the wiki:

  • pageview tracking
  • link tracking
  • if the user tracking is activated the current XWiki user page name
  • if the multidomain tracking is activated, the document title and the document domain

An important feature for Matomo would be the availability of GDPR compliance guidelines for some countries. For example, the French CNIL agency published a configuration guideline for websites:
Piwik is an analytics solution that could be configured to be exempted for the consent before storing a cookie. This guide explains how to configure Piwik to be inline with the CNIL recommendations3

How to use Google Analytics 4 with XWiki?

Google Tag


  • inside XWiki, navigate to the Admin UI and select "Look & Feel" and then "Presentation". Enter the HTML code inside the "HTTP META INFO" section, for example, as the last element, and then save.


Google Tag Manager

  • if you want to use Google Tag Manager, see this documentation on how to set it up and then in this documentation, section "Set up your Google tag in Google Tag Manager" on how to obtain the tag ID. You will see a similar code as the one shown in the Google Tag example above.


  • inside XWiki, navigate to the Admin UI and select "Look & Feel" and then "Presentation". Enter the HTML code inside the "HTTP META INFO" section, for example, as the last element, and then save.
  • In addition to the HTTP META INFO section update, you need to create a UIX extension point to insert the noscript tag proposed after the body:

    • Create a wiki page.
    • Enable your user to be Advanced .
    • Edit the page in object mode and add an object of type XWiki.UIExtensionClass (as mentioned on this tutorial).
    • Use "org.xwiki.platform.template.header.after" as the extension point:


    • Copy the noscript code from Google Tag Manager to the section "Executed Content":


How to use Matomo with XWiki?

The installation guide for the on-premise Matomo server is available on their dedicated website: https://matomo.org/docs/installation/.
The next step, on the XWiki side, is to install the Matomo extension from the wiki Administration section with Extension Manager. This extension is included on the list of “Recommended Extensions” for the XWiki platform and it’s supported for customers with Silver+ support plans.4 


How to use Albacross with XWiki?

This new option has been suggested by one of our clients, who wanted to use the Albacross tool. To start tracking your wiki visitors you need to install manually a tracking code to your wiki, using a JavaScript Extension Object. Check out the details in the dedicated FAQ page.

In a nutshell, these are tools that allow you to assess and analyze your website’s performance. Simply put, analytics tools help you:

  • Learn how your visitors find you;
  • Learn who your visitors are;
  • Understand how visitors interact with your site;
  • Identify your best-performing content;
  • Track conversions.

What other analytics extensions would you like to be added to the list?

1Take back control with Matomo Analytics – a powerful web analytics platform that gives you and your business 100% data ownership and user privacy protection.”, https://matomo.org/
3Original text extract from https://www.cnil.fr/sites/default/files/typo/document/Configuration_piwik.pdf : “Piwik est une solution d’analytics qui peut être paramétrée pour s’exempter de la demande de consentement avant de déposer un cookie. Ce guide vous explique comment configurer Piwik pour être en conformité avec les recommandations de la CNIL.

4At Silver and superior levels a wide range of questions is handled by XWiki experts including questions regarding the Matomo extension for XWiki, see https://xwiki.com/en/pricing/. The support for the setup of the Matomo server is not included on our standard plans.

You may also be interested in: