Google AMP validator fails due to 3rd-party script

Problem

The Google AMP validator fails when the New Relic Browser agent is included 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.

Cause

According to the AMP spec, HTML pages formatted for the AMP project aren't 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.

Solution

To ensure your AMP pages successfully validate, exclude the Browser agent JavaScript from only those pages. This will ensure AMP pages validate successfully and New Relic Browser will continue to accurately monitor your non-AMP pages.

To disable New Relic Browser on AMP pages, follow the instructions in Disable Browser monitoring for specific pages.

For more help

Additional documentation resources include:

Discuss Browser monitoring in the New Relic Online Technical Community! Troubleshoot and ask questions, or discuss JavaScript error reporting or AJAX timing in detail.

If you need additional help, get support at support.newrelic.com.