0

I am trying to use GTM's "Custom HTML Tag" option with the following code but it is giving me the following error: Invalid HTML, CSS, or JavaScript found in template.

I have implemented snippets from this source (taboola) before... I'm wondering what in this code is breaking it. Otherwise the code seems to be standard javascript:

<script>
_tfa.push({notify: 'event', name: 'landing_page_view', id: 1322998});
</script>
<noscript>
<img src='https://trc.taboola.com/1322998/log/3/unip?en=landing_page_view'
    width='0' height='0' style='display:none' referrerpolicy='no-referrer-when-downgrade'/>
</noscript>

I am grateful for any recommendations to solve the problem :)

2 Answers 2

1

GTM is a Javascript injector that will not do much without JS, so it is pointless to use it to implement a noscript tag.

However the actual problem are the non-standard attributes (a problem that might affect other tags than an image inside a noscript tag). So while in this particular case you can remove the noscript tag and its contents altogether, in other cases it would be sufficient to check which attributes Google deems valid for a given tag.

Note that the Google linter sometimes complains about attributes that otherwise would be considered okay, in your case the problem is the referrerpolicy attribute.

Sign up to request clarification or add additional context in comments.

Comments

0

Remove the "noscript" section.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.