---
title: nrSetCustomAttribute
source: https://docs.newrelic.com/docs/streaming-video-&-ads/installation/roku/agent-api/custom-attributes/nrsetcustomattribute
---

## Syntax

```js
  nrSetCustomAttribute(nr as Object, key as String, value as Object, actionName = "" as String) as Void
```

## Description

Set a custom attribute to be included in the events.

## Arguments

| Arguments    | Description                                                                  |
| ------------ | ---------------------------------------------------------------------------- |
| `nr`         | New Relic Agent object.                                                      |
| `key`        | Attribute name.                                                              |
| `value`      | Attribute value.                                                             |
| `actionName` | (optional) Action where the attribute will be included. Default all actions. |

## Return

Nothing.

## Example

```js
  	nrSetCustomAttribute(m.nr, "myNum", 123, "CONTENT_START")
	  nrSetCustomAttribute(m.nr, "myString", "hello")
```
