From ce3394fcfb075ea134a4fbe532bbb27f9393b931 Mon Sep 17 00:00:00 2001 From: Rosa Trieu Date: Fri, 12 Jun 2026 11:36:44 -0700 Subject: [PATCH 1/5] [DOCS-14565] Document anonymous_id for RUM Co-Authored-By: Claude Sonnet 4.6 --- .../browser/advanced_configuration.mdoc.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md b/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md index 2e9bb8841df..9ecc35b49d6 100644 --- a/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md +++ b/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md @@ -885,6 +885,16 @@ window.DD_RUM && window.DD_RUM.clearUser() ``` {% /if %} +### Track unauthenticated users + +If `setUser` is not called—for example, before a user logs in or for visitors who never authenticate—the RUM SDK automatically tracks activity using `usr.anonymous_id`. + +`usr.anonymous_id` is a randomly generated UUID (v4) that is not derived from any user PII, IP address, device fingerprint, or hardware identifier. It is stored in the Datadog session cookie (`_dd_s`) and persists for up to one year across sessions. The ID is scoped per browser and domain and does not track users across sites, devices, or browsers. + +The `anonymous_id` is cleared if the user revokes tracking consent with `setTrackingConsent('not-granted')` or clears their cookies. + +**Note**: `usr.anonymous_id` is enabled by default. To disable it, set `trackAnonymousUser: false` in your `init` config. + ## Account To group users into different set, use the account concept. From 670131aa3b810e92d07033cda57a2ac063c9b725 Mon Sep 17 00:00:00 2001 From: Rosa Trieu Date: Fri, 12 Jun 2026 11:41:23 -0700 Subject: [PATCH 2/5] [DOCS-14565] Add anonymous_id to Product Analytics docs Co-Authored-By: Claude Sonnet 4.6 --- content/en/product_analytics/data_collected.md | 4 +++- content/en/product_analytics/profiles.md | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/content/en/product_analytics/data_collected.md b/content/en/product_analytics/data_collected.md index 8a72f4445e6..3d235455a4d 100644 --- a/content/en/product_analytics/data_collected.md +++ b/content/en/product_analytics/data_collected.md @@ -22,7 +22,7 @@ Product Analytics collects user activity data as events. Each event has two type Every event includes the [default attributes](#default-attributes). Each event type also has [specific telemetry and attributes](#event-specific-attributes). -To identify individual users across sessions, Product Analytics relies on the `usr.id` and `usr.email` attributes. +To identify individual users across sessions, Product Analytics relies on the `usr.id` and `usr.email` attributes. For unauthenticated users or visitors who never log in, the RUM SDK automatically assigns a `usr.anonymous_id` to track activity. See [Track unauthenticated users][4] for details.
Product Analytics uses the same SDKs and configuration as Real User Monitoring (RUM) to collect data. Unlike RUM, Product Analytics does not collect Errors, Resources, Long Tasks, or Vitals events. For the full list of RUM event types and attributes, see the data collected pages for browser, iOS, and Android.
@@ -88,6 +88,7 @@ You can enable [tracking user info][3] globally to collect and apply user attrib | `usr.id` | string | Identifier of the user. | | `usr.name` | string | Name of the user. | | `usr.email` | string | Email of the user. | +| `usr.anonymous_id` | string | Randomly generated UUID assigned to unauthenticated users. Persists for up to one year. See [Track unauthenticated users][4]. | ## Event-specific attributes @@ -172,3 +173,4 @@ The following attributes are specific to each event type. [1]: /product_analytics/guide/action_management/ [2]: https://app.datadoghq.com/rum/list [3]: /real_user_monitoring/application_monitoring/browser/advanced_configuration/#user-session +[4]: /real_user_monitoring/application_monitoring/browser/advanced_configuration/#track-unauthenticated-users diff --git a/content/en/product_analytics/profiles.md b/content/en/product_analytics/profiles.md index 7c5c44880cd..4d434b8bd97 100644 --- a/content/en/product_analytics/profiles.md +++ b/content/en/product_analytics/profiles.md @@ -21,6 +21,8 @@ User and account profiles are generated from RUM events collected through the RU User profiles are grouped by the `user_id` attribute, while account profiles are grouped by `account_id`. +For unauthenticated users or visitors who never call `setUser`, the RUM SDK automatically tracks activity using `usr.anonymous_id`. See [Track unauthenticated users][9] for details. + You can also customize these pages by adding attributes that matter most to your team. See the [Custom Attributes section](#use-custom-attributes-to-enrich-profiles) to learn how to tailor profile data to your needs. @@ -188,3 +190,4 @@ You can filter these custom attributes throughout the product analytics platform [6]: https://app.datadoghq.com/product-analytics/segments [7]: https://app.datadoghq.com/product-analytics/profiles [8]: https://app.datadoghq.com/product-analytics/profiles/accounts +[9]: /real_user_monitoring/application_monitoring/browser/advanced_configuration/#track-unauthenticated-users From 65019c0a024d4259b532823b3966ca8c0326af3f Mon Sep 17 00:00:00 2001 From: Rosa Trieu Date: Fri, 12 Jun 2026 11:44:43 -0700 Subject: [PATCH 3/5] [DOCS-14565] Update advanced_configuration description Co-Authored-By: Claude Sonnet 4.6 --- .../browser/advanced_configuration.mdoc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md b/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md index 9ecc35b49d6..fadd93de722 100644 --- a/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md +++ b/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md @@ -1,6 +1,6 @@ --- title: Advanced Configuration -description: "Configure RUM Browser SDK to modify data collection, override view names, manage user sessions, and control sampling for your application's needs." +description: "Configure RUM Browser SDK to modify data collection, override view names, manage user sessions, track unauthenticated users, and control sampling for your application's needs." aliases: - /real_user_monitoring/installation/advanced_configuration/ - /real_user_monitoring/browser/modifying_data_and_context/ From c3410be9d259f69fcc53890d6652387a25fc47a4 Mon Sep 17 00:00:00 2001 From: Rosa Trieu Date: Fri, 12 Jun 2026 11:52:51 -0700 Subject: [PATCH 4/5] [DOCS-14565] Refine anonymous_id section wording Co-Authored-By: Claude Sonnet 4.6 --- .../browser/advanced_configuration.mdoc.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md b/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md index fadd93de722..34f94918bab 100644 --- a/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md +++ b/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md @@ -887,11 +887,16 @@ window.DD_RUM && window.DD_RUM.clearUser() ### Track unauthenticated users -If `setUser` is not called—for example, before a user logs in or for visitors who never authenticate—the RUM SDK automatically tracks activity using `usr.anonymous_id`. +For unauthenticated visitors or users who have not yet logged in, the RUM SDK automatically tracks activity using `usr.anonymous_id`. This lets you analyze user behavior without requiring authentication. -`usr.anonymous_id` is a randomly generated UUID (v4) that is not derived from any user PII, IP address, device fingerprint, or hardware identifier. It is stored in the Datadog session cookie (`_dd_s`) and persists for up to one year across sessions. The ID is scoped per browser and domain and does not track users across sites, devices, or browsers. +`usr.anonymous_id` is a randomly generated UUID (v4). It is not derived from any user PII, IP address, device fingerprint, or hardware identifier. -The `anonymous_id` is cleared if the user revokes tracking consent with `setTrackingConsent('not-granted')` or clears their cookies. +The ID has the following properties: + +- **Lifetime**: Persists for up to one year across sessions in the Datadog session cookie (`_dd_s`). +- **Scope**: Per-browser and per-domain. Incognito mode, cookie clearing, or switching browsers or devices produces a new `anonymous_id`. + +The ID resets if the user revokes tracking consent with `setTrackingConsent('not-granted')` or clears cookies. **Note**: `usr.anonymous_id` is enabled by default. To disable it, set `trackAnonymousUser: false` in your `init` config. From 5eb972114ff88bebe01709238b7410a5c310176e Mon Sep 17 00:00:00 2001 From: Rosa Trieu <107086888+rtrieu@users.noreply.github.com> Date: Fri, 12 Jun 2026 12:21:22 -0700 Subject: [PATCH 5/5] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Benoît --- .../browser/advanced_configuration.mdoc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md b/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md index 34f94918bab..b8ad8c64786 100644 --- a/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md +++ b/content/en/real_user_monitoring/application_monitoring/browser/advanced_configuration.mdoc.md @@ -893,12 +893,12 @@ For unauthenticated visitors or users who have not yet logged in, the RUM SDK au The ID has the following properties: -- **Lifetime**: Persists for up to one year across sessions in the Datadog session cookie (`_dd_s`). +- **Lifetime**: Persists for up to one year across sessions in the Datadog session cookie (`_dd_s_v2`). - **Scope**: Per-browser and per-domain. Incognito mode, cookie clearing, or switching browsers or devices produces a new `anonymous_id`. The ID resets if the user revokes tracking consent with `setTrackingConsent('not-granted')` or clears cookies. -**Note**: `usr.anonymous_id` is enabled by default. To disable it, set `trackAnonymousUser: false` in your `init` config. +**Note**: `usr.anonymous_id` is enabled by default. To disable it, set [`trackAnonymousUser: false`](https://datadoghq.dev/browser-sdk/interfaces/_datadog_browser-rum.RumInitConfiguration.html#trackanonymoususer) in your `init` config. ## Account