简体   繁体   English

Google 跟踪代码管理器容器验证错误

[英]Google Tag Manager Container Validation Error

I've received the following error from Google Tag Manager when attempting to preview a Custom HTML tag.尝试预览自定义 HTML 标记时,我从 Google 跟踪代码管理器收到以下错误。

Error Type: JavaScript compiler error错误类型:JavaScript 编译器错误

Error Description: Error at line 3, character 4: Parse error.错误描述:第 3 行错误,字符 4:解析错误。 '}' expected '}' 预期的

Google Tag Manager Validate Container Error Google 跟踪代码管理器验证容器错误

Below is the code included in the tag:以下是标签中包含的代码:

 <script> (function () { <img src="https://jelly.mdhv.io/v1/star.gif?pid=2XlZ2Enj2edTNcGWMlFSwZX2REIN&src=mh&evt=hi"> })(); </script>

Any help with troubleshooting this would is appreciated.任何有关故障排除的帮助将不胜感激。 Thanks in advance for your help!在此先感谢您的帮助!

It looks like you need to quote your HTML.看起来您需要引用您的 HTML。 You may also need to return it from the function as well - I've included this.您可能还需要从 function 将其return - 我已将其包含在内。

 <script> (function () { return '<img src="https://jelly.mdhv.io/v1/star.gif?pid=2XlZ2Enj2edTNcGWMlFSwZX2REIN&src=mh&evt=hi">' })(); </script>

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

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