- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
The Datadog Browser SDK can be used to instrument your application for both Real User Monitoring (RUM) and Error Tracking.
After your applications have been manually instrumented, you can begin managing your RUM and Error Tracking configurations per application in Datadog.
The Browser SDK supports all modern desktop and mobile browsers including IE11. For more information, see the Browser Support table.
You can set RUM configs on your web servers and Datadog will automatically inject RUM configs to instrument your RUM applications. Learn more about Auto-Instrumentation.
Request AccessTo set up Browser Monitoring, create an application in Datadog:
clientToken
and an applicationId
for your application.allowedTracingUrls
parameter to Connect RUM and Traces if you want to start linking requests from your web and mobile applications to their corresponding backend traces. See the full list of initialization parameters.Until Datadog starts receiving data, your application appears as pending
on the RUM Applications page.
clientToken
and an applicationId
for your application.Until Datadog starts receiving data, your application appears as pending
on the Applications page.
Add @datadog/browser-rum
to your package.json
file, then initialize it with:
import { datadogRum } from '@datadog/browser-rum'
datadogRum.init({
applicationId: '<DATADOG_APPLICATION_ID>',
clientToken: '<DATADOG_CLIENT_TOKEN>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: '<DATADOG_SITE>',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
import { datadogRum } from '@datadog/browser-rum'
datadogRum.init({
applicationId: '<DATADOG_APPLICATION_ID>',
clientToken: '<DATADOG_CLIENT_TOKEN>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: '<DATADOG_SITE>',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
datadogRum.startSessionReplayRecording();
import { datadogRum } from '@datadog/browser-rum'
datadogRum.init({
applicationId: '<DATADOG_APPLICATION_ID>',
clientToken: '<DATADOG_CLIENT_TOKEN>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: '<DATADOG_SITE>',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
datadogRum.startSessionReplayRecording();
import { datadogRum } from '@datadog/browser-rum'
datadogRum.init({
applicationId: '<DATADOG_APPLICATION_ID>',
clientToken: '<DATADOG_CLIENT_TOKEN>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: '<DATADOG_SITE>',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
datadogRum.startSessionReplayRecording();
import { datadogRum } from '@datadog/browser-rum'
datadogRum.init({
applicationId: '<DATADOG_APPLICATION_ID>',
clientToken: '<DATADOG_CLIENT_TOKEN>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: '<DATADOG_SITE>',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
datadogRum.startSessionReplayRecording();
import { datadogRum } from '@datadog/browser-rum';
datadogRum.init({
applicationId: '<APP_ID>',
clientToken: '<CLIENT_TOKEN>',
service: '<SERVICE>',
env: '<ENV_NAME>',
// site: '<SITE>',
// version: '1.0.0',
trackUserInteractions: true,
trackResources: true,
defaultPrivacyLevel: {default to the selection in form}
});
The trackUserInteractions
parameter enables the automatic collection of user clicks in your application. Sensitive and private data contained in your pages may be included to identify the elements interacted with.
Add the generated code snippet to the head tag of every HTML page you want to monitor in your application. For site:
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us1/v5/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/ap1/v5/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/eu1/v5/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us3/v5/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us5/v5/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/datadog-rum-v5.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/ap1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/eu1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us3/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us5/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/datadog-rum-v4.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/ap1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/eu1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us3/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us5/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/datadog-rum-v4.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/ap1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/eu1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us3/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us5/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/datadog-rum-v4.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/ap1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/eu1/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us3/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us5/v4/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/datadog-rum-v4.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM.startSessionReplayRecording();
})
</script>
Early RUM API calls must be wrapped in the window.DD_RUM.onReady()
callback. This ensures the code only gets executed once the SDK is properly loaded.
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/us1/v5/datadog-rum.js','DD_RUM')
window.DD_RUM.onReady(function() {
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APP_ID>',
// site: '<SITE>',
service: '<APP_ID>',
env: '<ENV_NAME>',
// version: '1.0.0',
trackUserInteractions: true,
trackResources: true,
defaultPrivacyLevel: {default to the selection in form}
});
})
</script>
The trackUserInteractions
parameter enables the automatic collection of user clicks in your application. Sensitive and private data contained in your pages may be included to identify the elements interacted with.
Add the generated code snippet to the head tag (in front of any other script tags) of every HTML page you want to monitor in your application. Including the script tag higher and synchronized ensures Datadog RUM can collect all performance data and errors. For site:
<script src="https://www.datadoghq-browser-agent.com/us1/v5/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
</script>
<script src="https://www.datadoghq-browser-agent.com/ap1/v5/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
</script>
<script src="https://www.datadoghq-browser-agent.com/eu1/v5/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
</script>
<script src="https://www.datadoghq-browser-agent.com/us3/v5/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
</script>
<script src="https://www.datadoghq-browser-agent.com/us5/v5/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
</script>
<script src="https://www.datadoghq-browser-agent.com/datadog-rum-v5.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
enablePrivacyForActionName: true,
});
</script>
<script src="https://www.datadoghq-browser-agent.com/us1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/ap1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/eu1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us3/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us5/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/datadog-rum-v4.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sessionSampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackUserInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/ap1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/eu1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us3/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us5/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/datadog-rum-v4.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
sessionReplaySampleRate: 100, // if not included, the default is 100
trackResources: true,
trackLongTasks: true,
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/ap1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/eu1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us3/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us5/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/datadog-rum-v4.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/ap1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ap1.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/eu1/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'datadoghq.eu',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us3/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us3.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/us5/v4/datadog-rum.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'us5.datadoghq.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
<script src="https://www.datadoghq-browser-agent.com/datadog-rum-v4.js" type="text/javascript"></script>
<script>
window.DD_RUM &&
window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
// `site` refers to the Datadog site parameter of your organization
// see https://docs.datadoghq.com/getting_started/site/
site: 'ddog-gov.com',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
replaySampleRate: 100, // if not included, the default is 100
trackInteractions: true,
});
window.DD_RUM &&
window.DD_RUM.startSessionReplayRecording();
</script>
The window.DD_RUM
check is used to prevent issues if a loading failure occurs with the RUM Browser SDK.
<script
src="https://www.datadoghq-browser-agent.com/us1/v5/datadog-rum.js"
type="text/javascript">
</script>
<script>
window.DD_RUM && window.DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APP_ID>',
// site: '<SITE>',
service: '<APP_ID>',
env: '<ENV_NAME>',
// version: '1.0.0',
trackUserInteractions: true,
trackResources: true,
defaultPrivacyLevel: {default to the selection in form}
});
</script>
The trackUserInteractions
parameter enables the automatic collection of user clicks in your application. Sensitive and private data contained in your pages may be included to identify the elements interacted with.
Types are compatible with TypeScript >= 3.8.2. To initialize the SDK, use the following code snippet.
import '@datadog/browser-rum/bundle/datadog-rum'
window.DD_RUM.init({
applicationId: 'XXX',
clientToken: 'XXX',
site: 'datadoghq.com',
...
})
Types are compatible with TypeScript >= 3.8.2. To initialize the SDK, use the following code snippet.
import '@datadog/browser-rum/bundle/datadog-rum'
window.DD_RUM.init({
applicationId: 'XXX',
clientToken: 'XXX',
site: 'datadoghq.com',
trackUserInteractions: true,
trackResources: true,
...
})
Call the initialization command to start tracking. The following parameters are available:
applicationId
clientToken
site
datadoghq.com
service
env
version
trackingConsent
"granted"
or "not-granted"
"granted"
trackViewsManually
false
trackUserInteractions
false
trackResources
false
trackLongTasks
false
defaultPrivacyLevel
mask
enablePrivacyForActionName
false
actionNameAttribute
sessionSampleRate
100
100
for all, 0
for none. Only tracked sessions send RUM events. For more details about sessionSampleRate
, see the sampling configuration.sessionReplaySampleRate
0
100
for all, 0
for none. For more details about sessionReplaySampleRate
, see the sampling configuration.startSessionReplayRecordingManually
false
startSessionReplayRecording()
is called, instead of at the beginning of the session. See Session Replay Usage for details.silentMultipleInit
false
proxy
allowedTracingUrls
traceSampleRate
100
100
for all, 0
for none. For more information, see Connect RUM and Traces.telemetrySampleRate
20
0
to opt out from telemetry collection.excludedActivityUrls
workerUrl
compressIntakeRequests
false
storeContextsAcrossPages
false
localStorage
to preserve them along the user navigation. See Contexts life cycle for more details and specific limitations.allowUntrustedEvents
false
Options that must have matching configuration when you are using the Logs Browser SDK:
trackSessionAcrossSubdomains
false
useSecureSessionCookie
false
usePartitionedCrossSiteSessionCookie
false
useSecureSessionCookie
.useCrossSiteSessionCookie
false
usePartitionedCrossSiteSessionCookie
.allowFallbackToLocalStorage
false
localStorage
when cookies cannot be set. This enables the RUM Browser SDK to run in environments that do not provide cookie support. See Monitor Electron Applications Using the Browser SDK for a typical use-case.applicationId
clientToken
site
datadoghq.com
service
env
version
trackingConsent
"granted"
or "not-granted"
"granted"
trackViewsManually
false
trackUserInteractions
false
trackResources
false
defaultPrivacyLevel
mask
enablePrivacyForActionName
false
actionNameAttribute
sessionSampleRate
100
100
for all, 0
for none. Only tracked sessions send RUM events. For more details about sessionSampleRate
, see the sampling configuration.silentMultipleInit
false
proxy
excludedActivityUrls
workerUrl
compressIntakeRequests
false
storeContextsAcrossPages
false
localStorage
to preserve them along the user navigation. See Contexts life cycle for more details and specific limitations.allowUntrustedEvents
false
Options that must have matching configuration when you are using the Logs Browser SDK:
trackSessionAcrossSubdomains
false
useSecureSessionCookie
false
usePartitionedCrossSiteSessionCookie
false
useSecureSessionCookie
.useCrossSiteSessionCookie
false
usePartitionedCrossSiteSessionCookie
.allowFallbackToLocalStorage
false
localStorage
when cookies cannot be set. This enables the Browser SDK to run in environments that do not provide cookie support. See Monitor Electron Applications Using the Browser SDK for a typical use case.A service is an independent, deployable code repository that maps to a set of pages.
After the Datadog browser RUM SDK is initialized, you can access the internal context of the SDK.
You can explore the following attributes:
Attribute | Description |
---|---|
application_id | ID of the application. |
session_id | ID of the session. |
user_action | Object containing action ID (or undefined if no action is found). |
view | Object containing details about the current view event. |
For more information, see RUM Browser Data Collected.
{
application_id : "xxx",
session_id : "xxx",
user_action: { id: "xxx" },
view : {
id : "xxx",
referrer : "",
url: "http://localhost:8080/",
name: "homepage"
}
}
You can optionally use startTime
parameter to get the context of a specific time. If the parameter is omitted, the current context is returned.
getInternalContext (startTime?: 'number' | undefined)
For NPM, use:
import { datadogRum } from '@datadog/browser-rum'
datadogRum.getInternalContext() // { session_id: "xxxx", application_id: "xxxx" ... }
For CDN async, use:
window.DD_RUM.onReady(function () {
window.DD_RUM.getInternalContext() // { session_id: "xxxx", application_id: "xxxx" ... }
})
For CDN sync, use:
window.DD_RUM && window.DD_RUM.getInternalContext() // { session_id: "xxxx", application_id: "xxxx" ... }
This option is not supported for Error Tracking.