• EnglishEspañol日本語한국어Português
  • Log inStart now

SetUserParameters (.NET agent)

Syntax

NewRelic.Api.Agent.NewRelic.SetUserParameters(string $user_value, string $account_value, string $product_value)

Create user-related custom attributes. AddCustomAttribute is more flexible.

Requirements

Compatible with all agent versions.

Must be called inside a transaction.

Description

Tip

This call only allows you to assign values to pre-existing keys. For a more flexible method to create key/value pairs, use AddCustomAttribute().

Define user-related custom attributesto associate with a browser page view (user name, account name, and product name). The values are automatically associated with pre-existing keys (user, account, and product), then attached to the parent APM transaction. You can also attach (or "forward") these attributes to browser PageView events.

Parameters

Parameter

Description

$user_value

string

Required (can be null). Specify a name or username to associate with this page view. This value is assigned to the user key.

$account_value

string

Required (can be null). Specify the name of a user account to associate with this page view. This value is assigned to the account key.

$product_value

string

Required (can be null). Specify the name of a product to associate with this page view. This value is assigned to the product key.

Examples

Record three user attributes

NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "MyAccountName", "MyProductName");

Record two user attributes and one empty attribute

NewRelic.Api.Agent.NewRelic.SetUserParameters("MyUserName", "", "MyProductName");
Copyright © 2024 New Relic Inc.

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