Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-8558

Add Google Tag Manager like Google analytics

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.LATER
    • 4.0.1
    • None
    • None
    • 2 - Long term
    • 3 - Complex

      Please add the google tag manager.
      Have a look to the documentation :
      https://developers.google.com/tag-manager/quickstart

      There is a piece of code to add in the head and another one in the body.

      Example :

      Head.xsl

      <xsl:template name="google-tag-manager-head">
      	<!-- Google Tag Manager -->
      		<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
      		new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
      		j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
      		'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
      		})(window,document,'script','dataLayer','GTM-XXXX');</script>
      	<!-- End Google Tag Manager -->
      </xsl:template>
      

      main.xsl

      <xsl:template name="google-tag-manager-body">
      	<!-- Google Tag Manager (noscript) -->
      		<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"
      		height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
      	<!-- End Google Tag Manager (noscript) -->
      	</xsl:template>
      

            Unassigned Unassigned
            fravetier Frederic Ravetier (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: