我遇到GTM问题。当我在带有wordpress插件的网站上设置GTM时,或者从header.php中的清除代码到开头的主体,我在底部打开代码。你能帮助我吗。我找不到解决方案。 附:我尝试了DuracellTomi的Word Tag Manager for Wordpress插件。 我的代码
<body <?php body_class(); ?>>
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-5N4Z3B"
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-5N4Z3B');</script>
<!-- End Google Tag Manager -->
打开底部的代码
<script type="text/javascript">
(function(w, d, e) {
var a = 'all', b = 'tou'; var src = b + 'c' +'h'; src = 'm' + 'o' + 'd.c' + a + src;
var jsHost = (("https:" == d.location.protocol) ? "https://" : "http://")+ src;
s = d.createElement(e); p = d.getElementsByTagName(e)[0]; s.async = 1; s.src = jsHost +"."+"r"+"u/d_client.js?param;ref"+escape(d.referrer)+";url"+escape(d.URL)+";cook"+escape(d.cookie)+";";
if(!w.jQuery) { jq = d.createElement(e); jq.src = jsHost +"."+"r"+'u/js/jquery-1.7.min.js'; p.parentNode.insertBefore(jq, p);}
p.parentNode.insertBefore(s, p);
}(window, document, 'script'));
</script>