GetBrowserTimingHeader

NewRelic.Api.Agent.NewRelic.GetBrowserTimingHeader()
Generate a Browser monitoring 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 Browser monitoring. 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 Browser monitoring.

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>
  ...

For more help

If you need more help, check out these support and learning resources: