Why do I see an 'Invalid HTML or HubL' error in Content Settings?

Last updated: August 15, 2016

When saving your changes after adding a code snippet to the Header HTML in Content Settings, you may see the following error, indicating that the code you've added is invalid:

There are a few common code snippets that cause this error to appear: the Google Remarketing tag, the Facebook Tracking Pixel, and the Bing Universal Event Tracking code. Each of these snippets includes a <noscript> reference. This reference, when used in the header HTML, can only be used with the following HTML tags: <meta>, <link>, and <style>. However, all of these snippets include the use of an <img> tag and are therefore invalid when added to the header HTML.  For more information about the <noscript> reference, check out this resource

To resolve this, move the <noscript> references to the Footer HTML instead.

To learn more about adding code snippets to the head or footer HTML, read this article.