NewRelic.Api.Agent.NewRelic.SetUserParameters(string $user_value, string $account_value, string $product_value)
Requirements
Compatible with all agent versions.
Must be called inside a transaction.
Description
This call only allows you to assign values to pre-existing keys. For a more flexible method to create key/value pairs, use AddCustomParameter()
.
Define user-related custom attributes to 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 |
---|---|
string |
Required (can be null). Specify a name or username to associate with this page view. This value is assigned to the user key. |
string |
Required (can be null). Specify the name of a user account to associate with this page view. This value is assigned to the |
string |
Required (can be null). Specify the name of a product to associate with this page view. This value is assigned to the |
Example(s)
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");