Statistical monitoring events


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

Presentation

Newsletter statistics can be obtained via a tracking manager such as Google Analytics or Matomo. Tracking covers the following events:

  • Sending: when a newsletter is validated, an event is generated for each e-mail sent.
  • Opening: when a user views the e-mail of a newsletter, an event is generated.
  • Clicking on a link: clicks on newsletter links to a site page are integrated into a "campaign".

The manager can be selected via a site configuration parameter :

Integration

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):

  • categoryTitle: the category title
  • title: newsletter title
  • number: newsletter number (can be empty if the "number" field in the content is not filled in)
  • date: the date of the newsletter in yyyy-MM-dd format (may be empty if the "date" content field is not filled in)

Opening

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 :

  • Category: "Newsletters / Title of the category
  • Action: "Open"
  • Label: "Title / Number / Date" where Title, Number and Date are the newsletter fields.

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.

Links

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:

  • Campaign: "Newsletters / Category title".
  • Support: email
  • Source: "Title / Number / Date" where Title, Number and Date are the newsletter fields.

The tracking manager must be integrated into the site for tracking to be effective.

Back to top

Newsletter