You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -40,84 +39,19 @@ To reduce Session Replay's network impact and ensure the Session Replay recorder
40
39
41
40
## Setup
42
41
43
-
Session Replay is available in the RUM Browser SDK. To start collecting data for Session Replay, set up [Datadog RUM Browser Monitoring][4] by creating a RUM application, generating a client token generation, and initializing the RUM Browser SDK. For setup in mobile environments, see [Mobile Session Replay][5].
42
+
Learn how to [set up and configure Browser Session Replay][4].
44
43
45
-
<divclass="alert alert-info">Session Replay is supported by SDK version 3.6.0 or later.</div>
44
+
## Privacy options
46
45
47
-
## Usage
46
+
See [Privacy Options][5].
48
47
49
-
Starting with v5.0.0 of the RUM Browser SDK, the Session Replay starts recording automatically when calling `init()`. To conditionally start the recording, use the `startSessionReplayRecordingManually` init parameter and call `startSessionReplayRecording()`.
48
+
## Troubleshooting
50
49
51
-
For example, to only record authenticated user sessions:
52
-
53
-
```javascript
54
-
window.DD_RUM.init({
55
-
applicationId:'<DATADOG_APPLICATION_ID>',
56
-
clientToken:'<DATADOG_CLIENT_TOKEN>',
57
-
site:'<DATADOG_SITE>',
58
-
// service: 'my-web-application',
59
-
// env: 'production',
60
-
// version: '1.0.0',
61
-
sessionSampleRate:100,
62
-
sessionReplaySampleRate:100,
63
-
startSessionReplayRecordingManually:true,
64
-
...
65
-
});
66
-
67
-
if (user.isAuthenticated) {
68
-
window.DD_RUM.startSessionReplayRecording();
69
-
}
70
-
```
71
-
72
-
To stop the Session Replay recording, call `stopSessionReplayRecording()`.
73
-
74
-
<divclass="alert alert-warning">When using a version of the RUM Browser SDK older than v5.0.0, Session Replay recording does not begin automatically. Call <code>startSessionReplayRecording()</code> to begin recording.</div>
75
-
76
-
## Force Session Replay
77
-
78
-
In some scenarios, you may want to begin recording a session after it has already started, even if it was initially sampled out of replay. For instance, you might want to force Session Replay on a newly deployed page for closer monitoring, or start recording after detecting an error to ensure complete replay data.
79
-
80
-
To force Session Replay recording for the rest of the current session, call `startSessionReplayRecording({ force: true })`
81
-
82
-
When using the force option, the session is upgraded to a replayed session for the remainder of its duration, regardless of its initial sampling decision.
83
-
84
-
<divclass="alert alert-warning">The force option only upgrades an existing session to a replayed one if it is already being sampled. In other words, if sampling hasn't started yet, using the force option does not initiate one, and no replay is recorded.</div>
85
-
86
-
## Disable Session Replay
87
-
88
-
To stop session recordings, set `sessionReplaySampleRate` to `0`. This stops collecting data for the [Browser RUM & Session Replay plan][6].
89
-
90
-
<divclass="alert alert-warning">If you're using a version of the RUM Browser SDK previous to v5.0.0, set <code>replaySampleRate</code> to <code>0</code>.</div>
91
-
92
-
## Retention
93
-
94
-
By default, Session Replay data is retained for 30 days.
95
-
96
-
To extend retention to 15 months, you can enable _Extended Retention_ on individual session replays. These sessions must be non-active (the user has completed their experience).
97
-
98
-
Extended Retention only applies to Session Replay and does not include associated events. The 15 months start when Extended Retention is enabled, not when the session is collected.
99
-
100
-
You can disable Extended Retention at any time. If the session replay is still within its default 30 days of retention, the replay expires at the end of the initial 30 day window. If you disable Extended Retention on a session replay that is older than 30 days, the replay immediately expires.
Refer to the below diagram to understand what data is retained with extended retention.
105
-
106
-
{{< img src="real_user_monitoring/session_replay/replay-extended-retention.png" alt="Diagram of what data is retained with extended retention" style="width:100%;" >}}
107
-
108
-
## Playback history
109
-
110
-
You can see who has watched a given session replay by clicking the **watched** count displayed on the player page. This feature allows you to check whether someone you'd like to share the recording with has already watched it.
111
-
112
-
{{< img src="real_user_monitoring/session_replay/session-replay-playback-history.png" alt="Check who has watched a session's recording" style="width:100%;" >}}
113
-
114
-
The history includes only playbacks that occurred in the player page or in an embedded player, like in a [Notebook][8] or side panel. Included playbacks also generate an [Audit Trail][7] event. Thumbnail previews are not included in history.
115
-
116
-
To view your own playback history, check out the [My Watch History][9] playlist.
50
+
Learn how to [troubleshoot Browser Session Replay][7].
117
51
118
52
## Mobile Session Replay
119
53
120
-
Learn more about the [Session Replay for Mobile][5].
54
+
Learn more about the [Session Replay for Mobile][8].
121
55
122
56
## Further Reading
123
57
@@ -126,9 +60,7 @@ Learn more about the [Session Replay for Mobile][5].
text: 'Detect and aggregate CSP violations with Datadog'
20
+
---
21
+
22
+
23
+
## Setup
24
+
25
+
To set up Mobile Session Replay for Browser:
26
+
27
+
### Step 1 - Setup the Browser SDK
28
+
29
+
Make sure you've set up the [RUM Browser SDK][1].
30
+
31
+
### Step 2 - Enable Session Replay
32
+
33
+
To enable session replay you have to specify the session replay sample rate. It must be a number between 0.0 and 100.0, where 0 indicates that no replays are recorded and 100 means that all RUM sessions include a replay.
34
+
35
+
This sample rate is applied in addition to the RUM sample rate. For example, if RUM uses a sample rate of 80% and Session Replay uses a sample rate of 20%, it means that out of all user sessions, 80% are included in RUM, and within those sessions, only 20% have replays.
36
+
See [Browser RUM & Session Replay sessions][2] for more information.
37
+
38
+
{{< tabs >}}
39
+
{{% tab "NPM" %}}
40
+
41
+
```javascript
42
+
import { datadogRum } from'@datadog/browser-rum';
43
+
44
+
datadogRum.init({
45
+
...
46
+
sessionReplaySampleRate:100,
47
+
...
48
+
});
49
+
50
+
```
51
+
52
+
{{% /tab %}}
53
+
{{% tab "CDN async" %}}
54
+
55
+
```javascript
56
+
<script>
57
+
window.DD_RUM.onReady(function() {
58
+
window.DD_RUM.init({
59
+
...
60
+
sessionReplaySampleRate:100,
61
+
...
62
+
});
63
+
})
64
+
</script>
65
+
```
66
+
67
+
{{% /tab %}}
68
+
{{% tab "CDN sync" %}}
69
+
70
+
```javascript
71
+
<script>
72
+
window.DD_RUM&&window.DD_RUM.init({
73
+
...
74
+
sessionReplaySampleRate:100,
75
+
...
76
+
});
77
+
</script>
78
+
```
79
+
80
+
**Note:** Bellow version v5.0.0, Session Replay does not start automatically and you need to call [`startSessionReplayRecording()`][3] API
81
+
82
+
{{% /tab %}}
83
+
{{< /tabs >}}
84
+
85
+
## Additional configuration
86
+
87
+
### Start or stop the recording manually
88
+
89
+
By default, Session Replay starts recording automatically.
90
+
However, if you prefer to manually start recording at a specific point in your application, you can use the option `startSessionReplayRecordingManually` parameter as shown below, and later call [`startSessionReplayRecording()`][3].
91
+
You can also use [`stopSessionReplayRecording()`][4] to stop the recording anytime.
**Note** In some scenarios, you may want to begin recording, even if it was initially sampled out of replay. To force Session Replay recording for the rest of the current session, call [`startSessionReplayRecording({ force: true })`][3]
150
+
151
+
### Privacy options
152
+
153
+
Session Replay provides privacy controls to ensure organizations of any scale do not expose sensitive or personal data.
154
+
See [Privacy Options][5].
155
+
156
+
### Connect Session Replay To Your Third-Party Tools
157
+
158
+
You can access the Session Replay URL to use in integrations, live from the browser where the session is taking place.
159
+
See [Connect Session Replay To Your Third-Party Tools][6].
0 commit comments