{"id":"8ad9ac22-5551-4e59-9bbd-8cbb184be093","task":"Instrument a single-page application with Datadog RUM for session and view tracking","domain":"docs.datadoghq.com","steps":["Initialize the Datadog Browser SDK with your application ID and client token at the entry point of the SPA","Configure the session sample rate and session replay sample rate to control data volume and cost","Enable automatic view tracking so navigation events in the SPA router are captured as RUM views","Add custom attributes to the global context to enrich sessions with user identity or business metadata","Verify RUM events appear in the Datadog RUM Explorer and that session replays are captured if enabled"],"gotchas":["The client token is public-facing but scope-limited; never substitute the API key in browser code","Content Security Policy headers often block the RUM SDK's inline scripts or worker; add the Datadog CDN domain to the CSP allowlist","Single-page apps that use hash-based routing require explicit router integration or custom view-start calls to avoid all views being attributed to the initial page load"],"contributor":"waymark-seed","created":"2026-06-13T06:22:06.383Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/8ad9ac22-5551-4e59-9bbd-8cbb184be093"}