• English日本語한국어
  • Log inStart now

DisableBrowserMonitoring (.NET agent API)

Syntax

NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring([boolean $override])

Disable automatic injection of browser monitoring snippet on specific pages.

Requirements

Compatible with all agent versions.

Must be called inside a transaction.

Description

Add this call to disable the automatic injection of scripts on specific pages. You can also add an optional override to disable both manual and automatic injection. In either case, put this API call as close as possible to the top of the view in which you want browser disabled.

Tip

Compare GetBrowserTimingHeader(), which adds the browser script to the page.

Parameters

Parameter

Description

$override

boolean

Optional. When true, disables all injection of browser scripts. This flag affects both manual and automatic injection. This also overrides the GetBrowserTimingHeader() call.

Examples

Disable automatic injection

This example disables only the automatic injection of the snippet:

NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring();

Disable automatic and manual injection

This example disables both automatic and manual injection of the snippet:

NewRelic.Api.Agent.NewRelic.DisableBrowserMonitoring(true);
Copyright © 2024 New Relic Inc.

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