Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable New Relic APM agent script in AMP responses #808

Closed
westonruter opened this issue Nov 17, 2017 · 0 comments
Closed

Disable New Relic APM agent script in AMP responses #808

westonruter opened this issue Nov 17, 2017 · 0 comments
Milestone

Comments

@westonruter
Copy link
Member

I've had to throw in an mu-plugin on a couple AMP plugin deployments for sites that have New Relic running:

add_action( 'pre_amp_render_post', function() {
	if ( extension_loaded( 'newrelic' ) ) {
		newrelic_disable_autorum();
	}
} );

This disables the New Relic APM agent from inserting its script in the head. This is needed to prevent AMP validation errors. It should probably be part of the AMP plugin itself since New Relic is pretty common. Adding support will remove one more thing that a user will have to do to set up AMP on their site.

For more, see https://docs.newrelic.com/docs/browser/new-relic-browser/troubleshooting/google-amp-validator-fails-due-3rd-party-script

We should also then see what we can do to add amp-analytics support for New Relic per https://docs.newrelic.com/docs/browser/new-relic-browser/installation/monitor-amp-pages-new-relic-browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant