GetBrowserTimingHeader()
Generate a New Relic Browser HTML snippet to instrument end-user browsers.

Requirements

Compatible with all agent versions.

Must be called inside a transaction.

Description

Returns an HTML snippet used to enable New Relic Browser. The snippet instructs the browser to fetch a small JavaScript file and start the page timer. You can then insert the returned snippet into the header of your HTML webpages. For more information, see Adding apps to New Relic Browser.

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

Return value(s)

An HTML string to be embedded in a page header.

Example(s)

With ASPX

<html>
  <head>
    <%= NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()%>
    ...
  </head>
  <body>
  ...

With Razor

<!DOCTYPE html>
<html lang="en">
  <head>
    @Html.Raw(NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader())
    ...
  </head>
  <body>
  ...