简体   繁体   中英

Google Tag Manager Container Validation Error

I've received the following error from Google Tag Manager when attempting to preview a Custom HTML tag.

Error Type: JavaScript compiler error

Error Description: Error at line 3, character 4: Parse error. '}' expected

Google Tag Manager Validate Container Error

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. You may also need to return it from the function as well - I've included this.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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