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 |
---|---|
string | Required (can be null). Specify a name or username to associate with this page view. This value is assigned to the |
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 |
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");