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ý.
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 ứng dụng của bạn cần thu thập thêm dữ liệu, bạn có thể thiết lập tối đa 25 Analytics thuộc tính người dùng trong ứng dụng.
Đăng ký dự án Unity và định cấu hình dự án đó để sử dụng Firebase.
Nếu dự án Unity của bạn đã sử dụng Firebase, thì dự án đó đã được đăng ký và định cấu hình cho Firebase.
Nếu chưa có dự án Unity, bạn có thể tải ứng dụng mẫu xuống.
Thêm FirebaseUnity SDK (cụ thể là FirebaseAnalytics.unitypackage) vào dự án Unity của bạn.
Xin lưu ý rằng việc thêm Firebase vào dự án Unity của bạn bao gồm các thao tác cả trong bảng điều khiển Firebase và trong dự án Unity đang mở của bạn (ví dụ: bạn tải tệp cấu hình Firebase xuống từ bảng điều khiển, sau đó di chuyển các tệp đó vào dự án Unity).
Đặ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ể phân tích hành vi của nhiều phân khúc người dùng bằng cách áp dụng các thuộc tính này làm bộ lọc cho báo cáo.
Thêm mã để đặt một thuộc tính người dùng Analytics bằng phương thức SetUserProperty(). Bạn có thể sử dụng tên và giá trị mà bạn chọn cho từng thuộc tính.
Ví dụ sau đây cho thấy cách thêm một thuộc tính giả định về món ăn yêu thích, trong đó chỉ định giá trị trong chuỗi mFavoriteFood cho người dùng đang hoạt động:
Chọn biểu tượng Analytics trong trình đơn để xem trang tổng quan báo cáo Analytics.
Thẻ Thuộc tính người dùng 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 làm bộ lọc 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-30 UTC."],[],[],null,["User properties are attributes you define to describe segments of your user\nbase, such as language preference or geographic location.\n\nAnalytics automatically logs some\n[user properties](https://support.google.com/analytics/answer/6317486);\nyou don't need to add any code to enable them. If your app needs to collect\nadditional data, you can set up to 25 different Analytics user properties\nin your app.\n\nBefore you begin\n\nBefore you can use\n[Google Analytics](/docs/reference/unity/namespace/firebase/analytics),\nyou need to:\n\n- Register your Unity project and configure it to use Firebase.\n\n - If your Unity project already uses Firebase, then it's already\n registered and configured for Firebase.\n\n - If you don't have a Unity project, you can download a\n [sample app](//github.com/google/mechahamster).\n\n- Add the [Firebase Unity SDK](/download/unity) (specifically, `FirebaseAnalytics.unitypackage`) to\n your Unity project.\n\n| **Find detailed instructions for these initial\n| setup tasks in\n| [Add Firebase to your Unity project](/docs/unity/setup#prerequisites).**\n\nNote that adding Firebase to your Unity project involves tasks both in the\n[Firebase console](//console.firebase.google.com/) and in your open Unity project\n(for example, you download Firebase config files from the console, then move\nthem into your Unity project).\n\nSet user properties\n\nYou can set Analytics user properties to describe the users of your app.\nYou can analyze behaviors of various user segments by applying these\nproperties as filters to your reports.\n\nSet a user property as follows:\n\n1. [Register](https://support.google.com/analytics/answer/6317519) the property in the **Analytics** tab\n of the [Firebase console](//console.firebase.google.com/).\n\n2. Add code to set an Analytics user property with the\n [`SetUserProperty()`](/docs/reference/unity/class/firebase/analytics/firebase-analytics#setuserproperty) method. You can use the name and\n value of your choosing for each property.\n\nThe following example shows adding a hypothetical favorite food property, which\nassigns the value in the string `mFavoriteFood` to the active user: \n\n```c#\nFirebase.Analytics.FirebaseAnalytics.SetUserProperty(\"favorite_food\", \"ice cream\");\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.\n\nYou can access this data as follows:\n\n1. In the [Firebase console](//console.firebase.google.com/), open your project.\n2. Select **Analytics** from the menu to view the Analytics reporting dashboard.\n\nThe **User Properties** tab shows a list of user properties that you have\ndefined for your app. You can use these properties as a filter on many of the\nreports available in Google Analytics. Read 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."]]