简体   繁体   English

Google跟踪代码管理器显示空白页

[英]Google Tag Manager display blank page

I was trying to implement a Google Tag Manager into my website but strangely when I had it and refresh my page it goes all Blank. 我试图在我的网站中实现Google跟踪代码管理器,但是奇怪的是,当我拥有它并刷新页面时,它全部空白。 (No specific error). (无特定错误)。

I tried the only upvoted solution from this thread that has no accepted answer yet : Same question 1year ago . 我尝试了从该线程获得的唯一被认可的解决方案,该解决方案尚未得到公认的答案: 1年以前,存在同样的问题 Still, this is not working for me. 不过,这对我不起作用。

I really dont get what is wrong with it (console is clean). 我真的不明白这是怎么回事(控制台很干净)。

If someone has an idea feel free to suggest. 如果有人有主意,请提出建议。

Tag for beter comprehension 更好理解的标签

<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXX"
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-XXXXX');</script>
<!-- End Google Tag Manager -->

Edit : 编辑:

I just tried it on an other website and it works without trouble. 我只是在其他网站上尝试过,它运行起来没有麻烦。

And has a complement information : When I put the right Google Tag Manager on the site I'am working on, if I go for View Page Source . 并且具有补充信息:如果我选择View Page Source ,则在我正在工作的网站上放置正确的Google跟踪代码管理器时。 It's all blank and when I Inspect it this is the output : 全部空白,当我Inspect ,这是输出:

在此处输入图片说明

Edit 2 : 编辑2:

The part with only the <noscript><iframe src="">.....</iframe></noscript> is not the problem (if I leave it without the function ) it works. 仅具有<noscript><iframe src="">.....</iframe></noscript>部分不是问题(如果我不带该function )。 For more information, this is the Website I'm working on -> http://www.agencedevoyage.com/ 有关更多信息,这是我正在使用的网站-> http://www.agencedevoyage.com/

SOLVED 解决了

It was Smarty, this stupid thing does not recognise it as a function or I don't know exactly what was going on. 那是Smarty,这个愚蠢的东西无法将其识别为功能,或者我不知道到底发生了什么。 Anyway the solution is to use those tags : {literal}....{/literal} 无论如何,解决方案是使用这些标签: {literal}....{/literal}

As say in my question I finally found the answer : 正如我的问题中所说,我终于找到了答案:

It was Smarty, which was not recognising GTM as a function or I don't know exactly what was going on. 是Smarty,它没有将GTM识别为功能,或者我不知道到底发生了什么。 Anyway the solution is to use those tags : {literal}....{/literal} 无论如何,解决方案是使用这些标签: {literal}....{/literal}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM