From f7e27d1b8d125b780991ca7ee9092e5bd7703c25 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov <kostja.osipov@gmail.com> Date: Tue, 7 Jun 2011 19:21:51 +0400 Subject: [PATCH] User guide: add Google analytics. --- doc/user/tnt-html.xsl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/user/tnt-html.xsl b/doc/user/tnt-html.xsl index cf270d1d1b..e1edda2131 100644 --- a/doc/user/tnt-html.xsl +++ b/doc/user/tnt-html.xsl @@ -12,4 +12,21 @@ <xsl:param name="highlight.source" select="1"/> <xsl:param name="highlight.xslthl.config">file:////usr/share/xml/docbook/stylesheet/docbook-xsl-ns/highlighting/xslthl-config.xml</xsl:param> +<!-- Add Google Analytics to the generated html--> + +<xsl:template name="user.head.content"> + <script type="text/javascript"> + + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-22120502-1']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + + </script> +</xsl:template> </xsl:stylesheet> -- GitLab