Initialize the Datadog RUM browser SDK to capture page views, user interactions, and Core Web Vitals

domain: docs.datadoghq.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install @datadog/browser-rum via npm or load the CDN snippet; call datadogRum.init() early in your app bootstrap before any navigation occurs
  2. Pass required init options: applicationId, clientToken, site (e.g., datadoghq.com or datadoghq.eu), service, env, version, and sessionSampleRate (0–100)
  3. Enable automatic collection of user interactions and resources by setting trackUserInteractions: true, trackResources: true, and trackLongTasks: true
  4. Call datadogRum.startSessionReplayRecording() after init if you want session replay; control replay volume separately via sessionReplaySampleRate
  5. Use datadogRum.setUser({ id, name, email }) after authentication to attach user identity to all subsequent RUM events for user-scoped analysis
  6. Verify data is flowing in the Datadog RUM > Sessions view; check the browser console for any init errors related to missing applicationId or blocked CSP headers

Known gotchas

Related routes

Set up the Datadog RUM browser SDK to capture page views, user actions, and custom errors
datadoghq.com · 6 steps · unrated
Track custom actions and attach global context in the Datadog RUM Browser SDK
docs.datadoghq.com · 5 steps · unrated
Instrument a single-page application with Datadog RUM for session and view tracking
docs.datadoghq.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans