You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/real_user_monitoring/application_monitoring/browser/tracking_user_actions.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,20 @@ The `trackUserInteractions` initialization parameter enables the collection of u
38
38
39
39
To control which information is sent to Datadog, you can [mask action names with privacy options][2], [manually set an action name](#declare-a-name-for-click-actions), or [implement a global scrubbing rule in the Datadog Browser SDK for RUM][3].
40
40
41
+
### Mask all action names
42
+
43
+
To mask all action names by default, use the `enablePrivacyForActionName` initialization parameter:
44
+
45
+
```javascript
46
+
window.DD_RUM.init({
47
+
...
48
+
trackUserInteractions:true,
49
+
enablePrivacyForActionName:true,
50
+
});
51
+
```
52
+
53
+
When enabled, all action names are replaced with `Masked Element`. Action names explicitly set with the `data-dd-action-name` attribute are still displayed, allowing you to selectively expose specific action names while keeping others masked.
54
+
41
55
## Track user interactions
42
56
43
57
The RUM Browser SDK automatically tracks clicks to generate click actions. A one-click action generally represents one user click, except when the same element is clicked multiple times in a row, which is considered a single action (see [Frustration Signals "rage clicks"][4]).
@@ -103,11 +117,13 @@ For example:
103
117
104
118
### How action names are computed
105
119
106
-
The Datadog Browser SDK uses different strategies to compute click action names:
120
+
The Datadog Browser SDK uses the following strategies to compute click action names:
107
121
108
122
1. If the `data-dd-action-name` attribute or a custom attribute (as explained above) is explicitly set by the user on the clicked element (or one of its parents), its value is used as the action name.
109
123
110
-
2. If `data-dd-action-name` attribute or its equivalent is not set, depending on the element type, the sdk uses other attributes such as `label`, `placeholder`, `aria-label` from the element or its parents to construct the action name. If none of these attributes is found, the sdk uses the inner text as name for the action.
124
+
2. If no explicit action name attribute is set and `enablePrivacyForActionName` is enabled, the action name is set to `Masked Element`.
125
+
126
+
3. Otherwise, depending on the element type, the SDK uses other attributes such as `label`, `placeholder`, or `aria-label` from the element or its parents to construct the action name. If none of these attributes is found, the SDK uses the inner text as the action name.
0 commit comments