Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Thuộc tính người dùng là những thuộc tính do bạn xác định để mô tả các phân khúc trong cơ sở người dùng, chẳng hạn như lựa chọn ưu tiên về ngôn ngữ hoặc vị trí địa lý. Bạn có thể dùng các thuộc tính này để xác định đối tượng cho ứng dụng của mình. Hướng dẫn này cho bạn biết cách thiết lập thuộc tính người dùng trong ứng dụng.
Analytics tự động ghi nhật ký một số thuộc tính người dùng; bạn không cần thêm mã nào để bật các thuộc tính này. Nếu cần thu thập thêm dữ liệu, bạn có thể thiết lập tối đa 25 thuộc tính người dùng cho mỗi dự án. Xin lưu ý rằng tên thuộc tính người dùng có phân biệt chữ hoa chữ thường. Khi bạn đặt tên giống nhau cho 2 thuộc tính người dùng và chỉ khác ở cách viết hoa viết thường, hệ thống sẽ ghi nhận đó là 2 thuộc tính người dùng riêng biệt.
Bạn không thể sử dụng một số ít tên thuộc tính người dùng do Google dành riêng:
Độ tuổi
Giới tính
Mối quan tâm
Trước khi bắt đầu
Đảm bảo rằng bạn đã thiết lập dự án và có thể truy cập vào Analytics như mô tả trong phần Bắt đầu sử dụng Analytics.
Đặt thuộc tính người dùng
Bạn có thể đặt Analytics thuộc tính người dùng để mô tả người dùng ứng dụng của bạn. Bạn có thể tận dụng thuộc tính người dùng bằng cách tạo định nghĩa tuỳ chỉnh, sau đó sử dụng các thuộc tính đó để áp dụng thông tin so sánh trong báo cáo hoặc làm tiêu chí đánh giá đối tượng.
Để đặt một thuộc tính người dùng, hãy làm theo các bước sau:
Bạn có thể truy cập vào dữ liệu này trên trang Định nghĩa tuỳ chỉnh của Analytics trong bảng điều khiển Firebase. Trang này cho thấy danh sách các thuộc tính người dùng mà bạn đã xác định cho ứng dụng của mình. Bạn có thể sử dụng các thuộc tính này trong thông tin so sánh trên nhiều báo cáo có trong Google Analytics.
Đọc thêm về trang tổng quan.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-21 UTC."],[],[],null,["iOS+ Android Web Flutter \n\n\u003cbr /\u003e\n\nUser properties are attributes you define to describe segments of your\nuser base, such as language preference or geographic location. These can be used\nto define [audiences](https://support.google.com/firebase/answer/6317509)\nfor your app. This guide shows you how to set user properties in your app.\n\nAnalytics automatically logs some\n[user properties](https://support.google.com/analytics/answer/9268042); you\ndon't need to add any code to enable them. If you need to collect additional\ndata, you can set up to 25 different user properties per project. Note that user\nproperty names are case-sensitive and that setting two user properties whose\nnames differ only in case results in two distinct user properties being logged.\n\nYou can't use a small set of user property names reserved by Google:\n\n- **Age**\n- **Gender**\n- **Interest**\n\nBefore you begin\n\nMake sure that you've set up your project and can access Analytics as\ndescribed in\n[Get Started with Analytics](/docs/analytics/get-started?platform=web).\n\nSet user properties\n\nYou can set Analytics user properties to describe the users of your app.\nYou can make use of user properties by creating custom definitions, then using\nthem to apply comparisons in your reports or as audience evaluation criteria.\n\nTo set a user property, follow these steps:\n\n1. Create a custom definition for the user property in the [**Custom Definitions** page](https://console.firebase.google.com/project/_/analytics/userproperty) of *Analytics* in the Firebase console. For more information, see [Custom dimensions and metrics](https://support.google.com/analytics/answer/10075209).\n2. Set a user property in your app with the [`setUserProperty()`](/docs/reference/js/analytics#setuserproperties) method.\n\nThe following example shows how to add a hypothetical \"favorite food\" property,\nwhich assigns the value in the string `food` to the active user: \n\nWeb \n\n```javascript\nimport { getAnalytics, setUserProperties } from \"firebase/analytics\";\n\nconst analytics = getAnalytics();\nsetUserProperties(analytics, { favorite_food: 'apples' });https://github.com/firebase/snippets-web/blob/467eaa165dcbd9b3ab15711e76fa52237ba37f8b/snippets/analytics-next/index/analytics_set_user_properties.js#L8-L11\n```\n\nWeb \n\n```javascript\nfirebase.analytics().setUserProperties({favorite_food: 'apples'});https://github.com/firebase/snippets-web/blob/467eaa165dcbd9b3ab15711e76fa52237ba37f8b/analytics/index.js#L38-L38\n```\n| **Note:** After the property is registered, it can take several hours for data collected with the property to be included in reports. When the new data is available, the user property can be used as a report filter or audience definition.\n\nYou can access this data from the\n[**Custom Definitions** page](https://console.firebase.google.com/project/_/analytics/userproperty)\nof *Analytics* in the Firebase console. The page shows a list of\nuser properties that you have defined for your app. You can use these properties\nin comparisons on many of the reports available in Google Analytics.\nRead more about the\n[dashboard](https://support.google.com/analytics/answer/11014767).\n| **Note:** Data in the Analytics reporting dashboard refreshes periodically throughout the day."]]