javascript - Google Tag Manager for 2 separate webapps on same host -
i have 2 web apps work (seamlessly users' perspective), deployed same tomcat instance. have added google tag manager code both respective index.html files. 1 of them works , other not (by mean console not appear doing gtm activity when hit url)
i'm new tagmanager maybe being naive. need separate tag manager registration each app?
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=gtm-my-code" 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-my-code');</script>
no. gtm not care host or app unless have configured triggers depend on host name, or app name. should see action, namely datalayer object populated few standard events (gtm.js, gtm.dom , gtm.load).
can't says causes problem, it's not you'd need multiple containers (although in many instances multiple containers per app idea, that's matter of how organize tags, not dictated technology).
Comments
Post a Comment