This page is intended for integrators with a minimum knowledge of HTML, CSS, XML, XSL, I18N.
You must have read the Graphic integration page of the newsletter
Newsletter statistics can be obtained via a tracking manager such as Google Analytics or Matomo. Tracking covers the following events:
The manager can be selected via a site configuration parameter :
The sending event doesn't require any special integration; it's handled by the e-mail sending engine, outside the graphic charter.
L'intégration des deux autres événements se fait dans le gabarit de la newsletter, dans le fichier skins/<myskin>/newsletter/<template>/stylesheets/template.xsl. Un exemple de ce gabarit se trouve dans la charte de démonstration, accessible à l'adresse suivante : https://code.ametys.org/projects/WEB/repos/template-web/browse/webapp/cms/skins/demo/newsletter/default/stylesheets/template.xsl
The stylesheet stylesheets/wa-newsletter.xsl in plugin newsletter provides templates XSL that can be called to set up event dispatch. To include it in the template, place the following instruction in the header of the template file.xsl:
<xsl:include href="plugin:newsletter://stylesheets/wa-newsletter.xsl" />
Before version 2.11 of plugin Newsletter, we only managed Google Analytics, so xsl was called plugin:newsletter://stylesheets/ga-newsletter.xsl
The following parameters are passed to the XSL template (but must still be declared as xsl:param):
To generate an event when the newsletter is opened, you need to call the following template (defined in the ga-newsletter.xsl file):
<xsl:call-template name="wa-analytics-newsletter"> <xsl:with-param name="categoryTitle" select="$categoryTitle"/> <xsl:with-param name="title" select="$title"/> <xsl:with-param name="number" select="$number"/> <xsl:with-param name="date" select="$date"/> </xsl:call-template>
Before version 2.11 of plugin Newsletter, we only managed Google Analytics, so the xsl template was called google-analytics-newsletter.
Ce template crée une balise <img> dont la source se trouve sur les serveurs du gestionnaire de suivi. Quand l'utilisateur visualise la newsletter, un événement est généré, ayant les propriétés suivantes :
Le template "wa-analytics-newsletter" ne génère la balise <img> que si le paramètre de site "Suivi des lettres d'information" est activé et que le ou les paramètres du gestionnaire de suivie sont renseignés.
When the wa-newsletter.xsl file is included, links to site pages are identified as coming from the newsletter.
When the user clicks on a link in the newsletter, the click is included in "traffic sources" with the following properties:
The tracking manager must be integrated into the site for tracking to be effective.