Track custom actions and attach global context in the Datadog RUM Browser SDK

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

Steps

  1. Call datadogRum.addAction(name, context) to record a custom action tied to a specific point in a user journey, with an optional context object.
  2. Call datadogRum.setGlobalContextProperty(key, value) right after datadogRum.init() to attach a property to every RUM event for the rest of the session.
  3. Use getGlobalContext() to inspect the currently attached global context, and removeGlobalContextProperty(key) to remove a single property.
  4. Alternatively call setGlobalContext(object) to replace the entire global context object at once; it is stored under @context on RUM events.
  5. Keep the combined size of global context, user information, and feature flag data under roughly 3KiB, per Datadog's guidance.

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
Initialize the Datadog RUM browser SDK to capture page views, user interactions, and Core Web Vitals
docs.datadoghq.com · 6 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