• /
  • EnglishEspañolFrançais日本語한국어Português
  • Se connecterDémarrer

newrelic_get_browser_timing_footer (PHP agent API)

Syntax

newrelic_get_browser_timing_footer([bool $include_tags])

Returns a 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 browser monitoring to a webpage. If possible, New Relic recommends instead enabling browser monitoring via the New Relic UI or copy/pasting the JavaScript snippet. For instructions on using these options, see Browser monitoring and the PHP agent.

Conseil

Compare newrelic_disable_autorum(), which disables the browser monitoring 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.

If false, returns the raw JavaScript string without <script> tags. This is useful if you need to add custom attributes to the script tag, such as nonce for Content Security Policy (CSP). For an example, see Add custom attributes such as nonce.

Return values

Returns the browser monitoring JavaScript footer string.

Examples

Instrument a webpage

function example(){
if (extension_loaded('newrelic')) { // Ensure PHP agent is available
$newrelic_header = newrelic_get_browser_timing_header();
}
// Output to page
if (extension_loaded('newrelic')) { // Ensure PHP agent is available
$newrelic_footer = newrelic_get_browser_timing_footer();
}
}
Droits d'auteur © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.