Question related to Google Analytics... but more specifically Tag Manager... I had been placing this code in my default.ascx page:
var tp = (CDefault)Page; tp.FindControl("Body").Controls.AddAt(0, new Literal()
{
Text = "<!-- Google Tag Manager --><script>dataLayer = [];</script><noscript><iframe src='//www.googletagmanager.com/ns.html?id=GTM-5FM3P5' height='0' width='0' style='display:none;visibility:hidden'></iframe></noscript><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 ='//www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);})(window, document, 'script', 'dataLayer', 'GTM-5FM3P5');</script><!-- End Google Tag Manager -->"
});
Which is fine, and added it right after the body tag... HOWEVER, it adds the SAME tag for ALL the portals... which is bad.
Is there a way to identify the different portals here (say with an if statement, etc) that will allow me to have a different tag for each portal?
Thanks in advance,
Dave