newrelic_get_browser_timing_footer

newrelic_get_browser_timing_footer([bool $include_tags])
Returns a New Relic Browser snippet to inject at the end of the HTML output.

Requirements

Compatible with all agent versions.

Description

Returns a JavaScript string to inject at the very end of the HTML output. Use this call with newrelic_get_browser_timing_header() to manually add New Relic Browser monitoring to a webpage. If possible, New Relic recommends instead enabling Browser via the New Relic UI or copy/pasting the JavaScript snippet. For instructions on using these options, see New Relic Browser and the PHP agent.

Compare newrelic_disable_autorum(), which disables the Browser script on a page.

Parameters

Parameter Description

$include_tags

boolean

Optional. Defaults to true.

If true or omitted, the string is enclosed in a <script> element for easy inclusion in the page's HTML.

Return value(s)

Returns the New Relic Browser JavaScript footer string.

Example(s)

Instrument a webpage

function example(){
    if (extension_loaded('newrelic')) { // Ensure PHP agent is available
        newrelic_get_browser_timing_header();
    }
    ... // Output to page
    if (extension_loaded('newrelic')) { // Ensure PHP agent is available
        newrelic_get_browser_timing_footer();
    }
}