Skip to content

RUM SDK: add more details on view lifecycle and beforeSend #29377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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 @@ -552,6 +552,17 @@ You can update the following event properties:

The RUM Browser SDK ignores modifications made to event properties not listed above. For more information about event properties, see the [RUM Browser SDK GitHub repository][15].

**Note**: Unlike other events, view events are sent multiple times to Datadog to reflect the updates occurring during their lifecycle. An update on a previous view event can still be sent while a new view is active. Datadog recommends being mindful of this behavior when modifying the content of a view event.

```javascript
beforeSend: (event) => {
// discouraged, as the current view name could be applied to both the active view and the previous views
event.view.name = getCurrentViewName()

// recommended
event.view.name = getViewNameForUrl(event.view.url)
}
```
### Discard a RUM event

With the `beforeSend` API, discard a RUM event by returning `false`:
Expand Down
Loading