Configure "Google Tag Manager" in Dspace ?

217 views
Skip to first unread message

Long nam

unread,
Jul 10, 2019, 12:23:48 PM7/10/19
to DSpace Community
hi All,
I want to install and configure  "Google Tag manager" into our current version Dspace-5.5. to allow us to create custom events in Google Analytics such as tracking downloads or capturing specific metadata. However, I can't seem to find the correct instruction on how to install it. 
Based from the Google Tag Manager information, it suggests to paste this code (below) as high in the <head> of the page as possible. But I'm not sure which index page to paste it in and to get it working. 
Your advice or suggestions will be much appreciated !!!
 

<!-- 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-N5H2HGD');</script>

<!-- End Google Tag Manager -->

 

Paste this code immediately after the opening <body> tag:

 

<!-- Google Tag Manager (noscript) -->

<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N5H2HGD"

height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>

<!-- End Google Tag Manager (noscript) -->

Leonardo Guerrero

unread,
Jul 10, 2019, 6:46:26 PM7/10/19
to DSpace Community
Hi. You must add it to xsl/core/page-structure.xsl. You can follow Google instructions searching <head> and <body> tags. Be aware of escape any "&" (ampersand) with its respective html entity.
Reply all
Reply to author
Forward
0 new messages