Implementing New Relic Real User Monitoring in Magento

A few months ago, New Relic introduced Real User Monitoring.  It natively supports WordPress and Drupal as of the time of this writing.  By “natively supports”, I mean you can just turn it on in the New Relic control panel and your web servers will start automatically injecting it into your pages’ head.  Real User Monitoring works with any web app, however — you just have to manually add the code yourself.

Here’s how you add it to a Magento theme template.
Edit app/design/frontend/[your_interface]/[your_theme]/template/page/html/header.phtml and add this at the top:


if ( extension_loaded('newrelic') ) {
echo newrelic_get_browser_timing_header();
}

Edit app/design/frontend/[your_interface]/[your_theme]/template/page/html/footer.phtml and add this at the bottom:


if ( extension_loaded('newrelic') ) {
echo newrelic_get_browser_timing_footer();
}

More about Real User Monitoring:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s