Skip to main content
To meet privacy requirements for different scenarios, the session replay feature has built-in flexible privacy protection strategies. By configuring the defaultPrivacyLevel field, developers can control data collection sensitivity, supporting modes from displaying all text (except passwords) to completely hiding page text, ensuring user data security and compliance.
The following inputs are treated as sensitive and are masked under every privacy setting: inputs whose type is password, email, tel, or hidden, and inputs whose autocomplete is cc-* (payment card data) or *-password.

Privacy policies

Configure defaultPrivacyLevel: "mask" to completely hide all text content on the page, preserving only operation behavior and page structure. Suitable for scenarios with high data privacy requirements.
Mask All Page Text

Configuration comparison

Set the privacy level for a specific element

defaultPrivacyLevel applies to the whole page. To hide or mask only a specific area (such as an account balance, an ID number, or an order details panel), add the data-dd-privacy attribute or a dd-privacy-<level> class to that element. Both forms behave the same. The level applies to the element and all of its descendants.

Example: hide an element

The same works in frameworks such as React:

Example: reveal an area while the page is masked

The page uses defaultPrivacyLevel: "mask", but non-sensitive areas such as the navigation bar should stay readable in replays:

How the levels apply

  • Child elements inherit their parent’s level. A child can override it with its own data-dd-privacy, for example setting allow on an element inside a mask area.
  • hidden cannot be overridden. Once a parent is set to hidden, setting allow on anything inside it has no effect.
  • Some inputs are always masked. Inputs whose type is password, email, tel, or hidden, and inputs whose autocomplete is cc-* (payment card data) or *-password, are masked even when set to allow.
  • Privacy rules are applied in the browser. Hidden or masked content is never uploaded and cannot be recovered later.