Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Here is the basic process for session tracking:
* Clicking
* Scrolling
* Typing
* Session is programatically reset when issuing a call to update user id via [setUserId()](/docs/browser/new-relic-browser/browser-apis/setuserid)
* Session tracking will not work properly in these situations:
* If users have DOM Storage disabled in their browser.
* If the browser or page is configured to **not** allow loading and execution of third-party origin scripts through security policies or other means (which naturally means the agent as a whole will not function).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Upon executing this function with a valid value, the browser agent records the v

The ID will be attached to JavaScriptError events in particular for [Errors Inbox](/docs/errors-inbox/errors-inbox/) usage. If you are using [SPA monitoring](/docs/browser/single-page-app-monitoring/get-started/welcome-single-page-app-monitoring) with a compatible agent version, user ID will also be included in [`newrelic.interaction`](/docs/browser/new-relic-browser/browser-agent-apis/browser-spa-api-newrelicinteraction) events.

Starting with agent version 1.306.0, if `resetSession` is set to `true`, the browser agent session will also be reset while updating the user identifier. Note: session will not be reset if the `enduser.id` attribute is not yet specified.

## Parameters

<table>
Expand Down Expand Up @@ -74,6 +76,19 @@ The ID will be attached to JavaScriptError events in particular for [Errors Inbo
Passing a `null` value unsets any existing user ID.
</td>
</tr>
<tr>
<td>
`resetSession`

_boolean_
</td>

<td>
Optional. A boolean to indicate whether to reset the browser agent session when updating the user identifier.

Note: the session reset will only take effect if the `enduser.id` attribute currently has a value.
</td>
</tr>
</tbody>
</table>

Expand All @@ -82,11 +97,11 @@ The ID will be attached to JavaScriptError events in particular for [Errors Inbo
### Marking an end user's "start of session"

```js
newrelic.setUserId('user-1234-v1.0')
newrelic.setUserId('user-1234-v1.0', true)
```

### Stopping events from attributing to current user

```js
newrelic.setUserId(null)
newrelic.setUserId(null, true)
```
Loading