Skip to content

Commit 45639a5

Browse files
bcaudanjanine-c
andauthored
RUM SDK: add more details on view lifecycle and beforeSend (#29377)
* RUM SDK: add more details on view lifecycle and beforeSend * ๐Ÿ‘Œ๏ธ remove empty lines Co-authored-by: Janine Chan <[email protected]> * ๐Ÿ‘Œ๏ธ improve phrasing Co-authored-by: Janine Chan <[email protected]> --------- Co-authored-by: Janine Chan <[email protected]>
1 parent 7c0385b commit 45639a5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

โ€Žcontent/en/real_user_monitoring/browser/advanced_configuration.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,17 @@ You can update the following event properties:
552552

553553
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].
554554

555+
**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.
556+
557+
```javascript
558+
beforeSend: (event) => {
559+
// discouraged, as the current view name could be applied to both the active view and the previous views
560+
event.view.name = getCurrentViewName()
561+
562+
// recommended
563+
event.view.name = getViewNameForUrl(event.view.url)
564+
}
565+
```
555566
### Discard a RUM event
556567

557568
With the `beforeSend` API, discard a RUM event by returning `false`:

0 commit comments

Comments
ย (0)