Google AMP validator fails due to 3rd-party script

Problem

The Google AMP validator fails when you include the New Relic Browser agent in HTML pages formatted for Google's Accelerated Mobile Pages (AMP) project.

For example, you may see a validation error that says:

The tag 'script' is disallowed except in specific forms.

Solution

To successfully validate your AMP pages and avoid the error message, set the following for your AMP pages:

This ensures that AMP pages validate successfully and that the New Relic Browser agent continues to monitor your non-AMP pages.

Cause

According to the AMP spec, HTML pages formatted for the AMP project are not allowed to contain any author-written or third-party JavaScript. By default, the New Relic Browser agent will be included in any pages served by your application, including the pages which are intended only for consumption by the AMP webcrawler.

For more help

Recommendations for learning more: