This page is intended for integrators with a minimum knowledge of HTML, CSS, XML, XSL, I18N.
You must have read Plugin Newsletter - Graphic integration - v1.6.0
Newsletter statistics can be obtained via Google Analytics. The following events are tracked:
The sending event doesn't require any special integration; it's managed 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 : http://viewvc.ametys.org/viewvc/trunk/templates/cmsweb/trunk/webapp/cms/skins/demo/newsletter/default/stylesheets/template.xsl
The stylesheet stylesheets/ga-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/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="google-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>
Ce template crée une balise <img> dont la source se trouve sur les serveurs de Google. Quand l'utilisateur visualise la newsletter, un événement Google Analytics est généré, ayant les propriétés suivantes :
Le template "google-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 paramètre de site "ID de site web Google" est renseigné.
When the ga-newsletter.xsl file is included, links to site pages are identified in Google Analytics as coming from the newsletter.
When the user clicks on a link in the newsletter, the click is taken into account in the Google Analytics "traffic sources" with the following properties:
Google Analytics must be integrated into the site for tracking to be effective.