Displaying Matomo statistics


This page should only be applied if the script assisted migration asks you to skip manual migration skin.20240715.INTRANETSEARCH.MatomoStats

As of version 2.1.0 of Skin Intranet Search, Matomo statistics on the number of visits can be displayed on each page.

The display of statistics must be activated in the site parameters, and theurl and Matomo server key must be entered in the application configuration parameters.

Statistics on the number of visits are displayed on the front office only.

Statistics on the number of visits are displayed on all pages with Page or Large templates.

Statistics activation

If you have overloaded the template XSL <xsl:template name="head"> (file stylesheets/head.xsl)You need to add a call to the "matomo" template to activate the calculation of visit statistics.

<xsl:template name="head">
        <head>
            <meta http-equiv="X-UA-Compatible" content="IE=9" />
            <title><xsl:call-template name="get-title"/></title>
            
            [...]
            <xsl:call-template name="matomo"/>
       </head>
</xsl:template>

Statistics display

A call to the "head-js-matomo" template is required from the "common-script" template. If you have overloaded the "common-script" template, add it.

<xsl:template name="common-script">
        [...]
        
        <xsl:call-template name="head-js-matomo"/>
        
        <xsl:call-template name="custom-script"/>
</xsl:template>

Visitor statistics are displayed just above the breadcrumb trail by calling the "matomo-stats" template.

If you've overloaded the"main-zone" template in the page template, you'll need to add the call to this template, just above the call to the "bread-crumb" template.

<xsl:template name="main-zone">
        <xsl:choose>
            <xsl:when test="$hasMainImg">
                <div class="image-internal-container template-{$template}">
                  [...]
                    
                    <div class="top">
                        <div class="left">
                            <xsl:call-template name="matomo-stats"/>
                            <xsl:call-template name="bread-crumb"/>
                            
                          [...]
                        </div>
                        <xsl:call-template name="right"/>
                    </div>
                </div>
            </xsl:when>
            <xsl:otherwise>
                <div class="page-container template-{$template}">
                    <div class="top">
                        <div class="left">
                            <xsl:call-template name="matomo-stats"/>
                            <xsl:call-template name="bread-crumb"/>
                            
                          [...]
                        </div>
                        <xsl:call-template name="right"/>
                    </div>
                </div>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

 

Back to top