Skip to content

Commit 909301f

Browse files
authored
Merge pull request #128 from flashcatcloud/doc-review/2026-06-30-rum-user-fields
[codex] clarify mobile RUM user fields
2 parents 47d0ce0 + dcd7f5c commit 909301f

10 files changed

Lines changed: 59 additions & 90 deletions

en/rum/sdk/android/advanced-config.mdx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ public void onHeroImageLoaded() {
246246
After setting timing, access it via `@view.custom_timings.<timing_name>`, e.g., `@view.custom_timings.hero_image`.
247247
</Tip>
248248

249-
### Add User Attributes
249+
### Set User Information
250250

251-
The RUM SDK automatically tracks user attributes. You can also add additional custom user attributes like user plan, user group, etc.
251+
The RUM SDK supports standard user information.
252252

253253
<Tabs>
254254
<Tab title="Kotlin">
@@ -258,38 +258,28 @@ import com.datadog.android.rum.GlobalRumMonitor
258258
GlobalRumMonitor.get().setUserInfo(
259259
id = "1234",
260260
name = "John Doe",
261-
email = "john@doe.com",
262-
extraInfo = mapOf(
263-
"plan" to "premium",
264-
"group" to "vip"
265-
)
261+
email = "john@doe.com"
266262
)
267263
```
268264
</Tab>
269265

270266
<Tab title="Java">
271267
```java
272268
import com.datadog.android.rum.GlobalRumMonitor;
273-
import java.util.HashMap;
274-
import java.util.Map;
275-
276-
Map<String, Object> extraInfo = new HashMap<>();
277-
extraInfo.put("plan", "premium");
278-
extraInfo.put("group", "vip");
279269

280270
GlobalRumMonitor.get().setUserInfo(
281271
"1234",
282272
"John Doe",
283273
"john@doe.com",
284-
extraInfo
274+
null
285275
);
286276
```
287277
</Tab>
288278
</Tabs>
289279

290-
<Tip>
291-
Custom user attributes can be used to group and filter data in the Insights dashboard, helping you understand usage patterns of different user groups.
292-
</Tip>
280+
<Warning>
281+
Only standard user fields are supported: `id`, `name`, `email`, and `anonymous_id`. Other user attributes are not supported. If needed, configure them under `context`.
282+
</Warning>
293283

294284
## Event and Data Management
295285

en/rum/sdk/android/data-collection.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The SDK automatically attaches the following system context to help diagnose per
4747
| OS information | Android version, major version, build number, locale, time zone | Diagnose OS-version or region-specific issues |
4848
| Network information | Network type, cellular technology, carrier name, uplink/downlink bandwidth, signal strength | Analyze how network quality affects user experience |
4949
| RUM events | View, Action, Resource, Error, Long Task, app startup timing | Reconstruct user journeys and diagnose errors or performance bottlenecks |
50-
| User information | `usr.id`, `usr.name`, `usr.email`, and custom attributes | Attached only when your app explicitly sets user data through the API |
50+
| User information | `usr.id`, `usr.name`, `usr.email`, `usr.anonymous_id` | Attached only when your app explicitly sets user data through the API; other user attributes are not supported. If needed, configure them under `context` |
5151

5252
<Info>
5353
The geo-location fields documented below are inferred by the Flashduty backend from the client request IP address. They are not collected from Android system location APIs. The SDK does not call GPS, cell-tower location, or fused location APIs, and it does not require location permissions.
@@ -189,10 +189,11 @@ You can set user information via the `setUser()` API, which will be attached to
189189
| `usr.id` | string | User's unique identifier |
190190
| `usr.name` | string | User's friendly name |
191191
| `usr.email` | string | User's email address |
192+
| `usr.anonymous_id` | string | Anonymous user identifier |
192193

193-
<Tip>
194-
You can also add custom user attributes such as `usr.plan`, `usr.role`, etc.
195-
</Tip>
194+
<Note>
195+
Only the standard user fields above are supported. Other user attributes are not supported. If needed, configure them under `context`.
196+
</Note>
196197

197198
</Accordion>
198199

en/rum/sdk/ios/advanced-config.mdx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ RUMMonitor.shared().addError(
172172
</Tab>
173173
</Tabs>
174174
175-
### Add User Attributes
175+
### Set User Information
176176
177177
Set user information for the current session:
178178
@@ -184,11 +184,7 @@ import DatadogCore
184184
Datadog.setUserInfo(
185185
id: "user-123",
186186
name: "John Doe",
187-
email: "john.doe@example.com",
188-
extraInfo: [
189-
"plan": "premium",
190-
"signup_date": "2024-01-15"
191-
]
187+
email: "john.doe@example.com"
192188
)
193189
```
194190
</Tab>
@@ -200,17 +196,14 @@ Datadog.setUserInfo(
200196
[DDDatadog setUserInfoWithId:@"user-123"
201197
name:@"John Doe"
202198
email:@"john.doe@example.com"
203-
extraInfo:@{
204-
@"plan": @"premium",
205-
@"signup_date": @"2024-01-15"
206-
}];
199+
extraInfo:nil];
207200
```
208201
</Tab>
209202
</Tabs>
210203
211-
<Tip>
212-
Custom user attributes can be used to group and filter data in the Insights dashboard.
213-
</Tip>
204+
<Warning>
205+
Only standard user fields are supported: `id`, `name`, `email`, and `anonymous_id`. Other user attributes are not supported. If needed, configure them under `context`.
206+
</Warning>
214207
215208
## Event and Data Management
216209

en/rum/sdk/ios/data-collection.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,16 @@ You can enable user tracking on all RUM events to correlate user sessions and si
122122
| `usr.id` | String | User unique identifier |
123123
| `usr.name` | String | User-friendly name, displayed by default in RUM UI |
124124
| `usr.email` | String | User email address, displayed if no username |
125+
| `usr.anonymous_id` | String | Anonymous user identifier |
125126

126127
<Tip>
127128
User attributes are optional but we recommend providing at least one. See [Track User Information](/en/rum/sdk/ios/sdk-integration#track-user-information).
128129
</Tip>
129130

131+
<Note>
132+
Only the standard user fields above are supported. Other user attributes are not supported. If needed, configure them under `context`.
133+
</Note>
134+
130135
</Accordion>
131136

132137
</AccordionGroup>

en/rum/sdk/ios/sdk-integration.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,17 +419,13 @@ import DatadogCore
419419
Datadog.setUserInfo(
420420
id: "user-123",
421421
name: "John Doe",
422-
email: "john.doe@example.com",
423-
extraInfo: [
424-
"plan": "premium",
425-
"signup_date": "2024-01-15"
426-
]
422+
email: "john.doe@example.com"
427423
)
428424
```
429425

430-
<Tip>
431-
Custom user attributes (like `plan`, `signup_date`) can be used to group and filter data in the Insights dashboard.
432-
</Tip>
426+
<Warning>
427+
Only standard user fields are supported: `id`, `name`, `email`, and `anonymous_id`. Other user attributes are not supported. If needed, configure them under `context`.
428+
</Warning>
433429

434430
### Offline Data Handling
435431

zh/rum/sdk/android/advanced-config.mdx

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ public void onHeroImageLoaded() {
247247
设置计时后,可通过 `@view.custom_timings.<timing_name>` 访问,例如 `@view.custom_timings.hero_image`
248248
</Tip>
249249

250-
### 添加用户属性
250+
### 设置用户信息
251251

252-
RUM SDK 会自动追踪用户属性。您还可以添加额外的自定义用户属性,例如用户计划、用户组等
252+
RUM SDK 支持设置标准用户信息
253253

254254
<Tabs>
255255
<Tab title="Kotlin">
@@ -259,38 +259,28 @@ import com.datadog.android.rum.GlobalRumMonitor
259259
GlobalRumMonitor.get().setUserInfo(
260260
id = "1234",
261261
name = "John Doe",
262-
email = "john@doe.com",
263-
extraInfo = mapOf(
264-
"plan" to "premium",
265-
"group" to "vip"
266-
)
262+
email = "john@doe.com"
267263
)
268264
```
269265
</Tab>
270266

271267
<Tab title="Java">
272268
```java
273269
import com.datadog.android.rum.GlobalRumMonitor;
274-
import java.util.HashMap;
275-
import java.util.Map;
276-
277-
Map<String, Object> extraInfo = new HashMap<>();
278-
extraInfo.put("plan", "premium");
279-
extraInfo.put("group", "vip");
280270

281271
GlobalRumMonitor.get().setUserInfo(
282272
"1234",
283273
"John Doe",
284274
"john@doe.com",
285-
extraInfo
275+
null
286276
);
287277
```
288278
</Tab>
289279
</Tabs>
290280

291-
<Tip>
292-
自定义用户属性可用于在分析看板中分组和过滤数据,帮助您了解不同用户群体的使用情况
293-
</Tip>
281+
<Warning>
282+
当前仅支持设置用户标准字段:`id``name``email``anonymous_id`;其他用户属性不支持。如有需求,可以在 `context` 字段进行配置
283+
</Warning>
294284

295285
## 事件和数据管理
296286

@@ -464,6 +454,10 @@ GlobalRumMonitor.get().setUserInfo("1234", "John Doe", "john@doe.com", null);
464454
</Tab>
465455
</Tabs>
466456

457+
<Warning>
458+
当前仅支持设置用户标准字段:`id``name``email``anonymous_id`;其他用户属性不支持。如有需求,可以在 `context` 字段进行配置。
459+
</Warning>
460+
467461
<Note>
468462
**参数说明:**
469463
- `id` (String) - 唯一用户标识符

zh/rum/sdk/android/data-collection.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ SDK 会自动附加以下系统上下文,帮助排查性能、崩溃和网络
4848
| 系统信息 | Android 版本、系统主版本、系统构建号、语言、时区 | 定位系统版本或区域相关问题 |
4949
| 网络信息 | 网络类型、蜂窝网络制式、运营商名称、上下行带宽、信号强度 | 分析网络质量对体验的影响 |
5050
| RUM 事件 | View、Action、Resource、Error、Long Task、启动耗时 | 还原用户旅程、定位错误和性能瓶颈 |
51-
| 用户信息 | `usr.id``usr.name``usr.email` 及自定义属性 | 仅在业务主动调用 API 设置时附加 |
51+
| 用户信息 | `usr.id``usr.name``usr.email``usr.anonymous_id` | 仅在业务主动调用 API 设置时附加;其他用户属性不支持。如有需求,可以在 `context` 字段进行配置 |
5252

5353
<Info>
5454
本文档列出的“地理位置”字段由 Flashduty 后端根据客户端请求 IP 推断,不是 Android 客户端读取系统定位。SDK 不调用 GPS、基站定位或融合定位 API,也不需要定位权限。
@@ -190,10 +190,11 @@ RUM 可以从用户的 IP 地址推断出地理位置信息:
190190
| `usr.id` | string | 用户的唯一标识符 |
191191
| `usr.name` | string | 用户的友好名称 |
192192
| `usr.email` | string | 用户的电子邮件地址 |
193+
| `usr.anonymous_id` | string | 匿名用户标识符 |
193194

194-
<Tip>
195-
您还可以添加自定义用户属性,例如 `usr.plan``usr.role`
196-
</Tip>
195+
<Note>
196+
当前仅支持以上用户标准字段,其他用户属性不支持。如有需求,可以在 `context` 字段进行配置
197+
</Note>
197198

198199
</Accordion>
199200

zh/rum/sdk/ios/advanced-config.mdx

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,7 @@ import DatadogCore
272272
Datadog.setUserInfo(
273273
id: "1234",
274274
name: "John Doe",
275-
email: "john@doe.com",
276-
extraInfo: [
277-
"plan": "premium",
278-
"signup_date": "2024-01-15"
279-
]
275+
email: "john@doe.com"
280276
)
281277
```
282278
</Tab>
@@ -288,11 +284,15 @@ Datadog.setUserInfo(
288284
[DDDatadog setUserInfoWithId:@"1234"
289285
name:@"John Doe"
290286
email:@"john@doe.com"
291-
extraInfo:@{@"plan": @"premium", @"signup_date": @"2024-01-15"}];
287+
extraInfo:nil];
292288
```
293289
</Tab>
294290
</Tabs>
295291
292+
<Warning>
293+
当前仅支持设置用户标准字段:`id`、`name`、`email`、`anonymous_id`;其他用户属性不支持。如有需求,可以在 `context` 字段进行配置。
294+
</Warning>
295+
296296
<Note>
297297
**参数说明:**
298298
- `usr.id` (字符串) - 唯一用户标识符
@@ -637,19 +637,7 @@ Datadog.set(trackingConsent: .granted)
637637
638638
## 添加用户属性
639639
640-
您可以使用 `Datadog.addUserExtraInfo(_:)` API 将额外的用户属性附加到先前设置的属性上。
641-
642-
```swift
643-
import DatadogCore
644-
645-
Datadog.addUserExtraInfo(["company": "Flashduty"])
646-
```
647-
648-
```objective-c
649-
@import DatadogObjc;
650-
651-
[DDDatadog addUserExtraInfo:@{@"company": @"Flashduty"}];
652-
```
640+
当前仅支持设置用户标准字段:`id`、`name`、`email`、`anonymous_id`;其他用户属性不支持。如有需求,可以在 `context` 字段进行配置。
653641
654642
## 数据管理
655643

zh/rum/sdk/ios/data-collection.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,16 @@ iOS RUM SDK 为所有事件自动附加默认属性,帮助您了解用户设
123123
| `usr.id` | 字符串 | 用户的唯一标识符 |
124124
| `usr.name` | 字符串 | 用户友好名称,默认显示在 RUM UI 中 |
125125
| `usr.email` | 字符串 | 用户电子邮件地址,如果没有用户名则显示电子邮件 |
126+
| `usr.anonymous_id` | 字符串 | 匿名用户标识符 |
126127

127128
<Tip>
128129
用户属性是可选的,但建议至少提供一个。详见 [追踪用户信息](/zh/rum/sdk/ios/sdk-integration#追踪用户信息)
129130
</Tip>
130131

132+
<Note>
133+
当前仅支持以上用户标准字段,其他用户属性不支持。如有需求,可以在 `context` 字段进行配置。
134+
</Note>
135+
131136
</Accordion>
132137

133138
</AccordionGroup>

zh/rum/sdk/ios/sdk-integration.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -420,17 +420,13 @@ import DatadogCore
420420
Datadog.setUserInfo(
421421
id: "user-123",
422422
name: "John Doe",
423-
email: "john.doe@example.com",
424-
extraInfo: [
425-
"plan": "premium",
426-
"signup_date": "2024-01-15"
427-
]
423+
email: "john.doe@example.com"
428424
)
429425
```
430426

431-
<Tip>
432-
自定义用户属性(如 `plan``signup_date`)可用于在分析看板中分组和过滤数据
433-
</Tip>
427+
<Warning>
428+
当前仅支持设置用户标准字段:`id``name``email``anonymous_id`;其他用户属性不支持。如有需求,可以在 `context` 字段进行配置
429+
</Warning>
434430

435431
### 离线数据处理
436432

0 commit comments

Comments
 (0)