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.
Tài liệu này giải thích cách bạn có thể xoá dữ liệu được liên kết với một mã nhận dạng người dùng nhất định
bằng cách sử dụng API Xoá người dùng của Google Analytics. Công cụ này là một trong số nhiều công cụ có thể giúp bạn bảo vệ dữ liệu của mình.
Bạn có thể sử dụng dự án Firebase hoặc tài sản Google Analytics để gửi yêu cầu API xoá người dùng. Bạn bắt buộc phải có phạm vi OAuth 2.0 https://www.googleapis.com/auth/analytics.user.deletion cho các yêu cầu trong hướng dẫn này.
Gửi yêu cầu xoá
Sử dụng phương thức upsert để yêu cầu xoá dữ liệu cho một người dùng cụ thể. Phương thức upsert lấy userDeletionRequest làm tham số duy nhất.
Chỉ định người dùng có dữ liệu mà bạn muốn xoá bằng cách đặt một trong các mã nhận dạng bên trong trường id.userId. Bạn phải chỉ định loại mã nhận dạng bên trong trường id.type.
Dưới đây là danh sách các loại mã nhận dạng người dùng được hỗ trợ:
CLIENT_ID: Mã ứng dụng của Google Analytics (chỉ được hỗ trợ khi bạn đặt trường propertyId).
USER_ID: Mã nhận dạng người dùng của Google Analytics (chỉ được hỗ trợ khi bạn đặt trường propertyId).
APP_INSTANCE_ID: Mã phiên bản ứng dụng của Firebase (chỉ được hỗ trợ khi bạn đặt trường firebaseProjectId hoặc propertyId).
Mỗi yêu cầu xoá dữ liệu chỉ xử lý mã nhận dạng được gửi trong yêu cầu đó.
Nếu có nhiều mã nhận dạng được liên kết với cùng một người dùng, bạn phải gửi các yêu cầu xoá riêng cho từng mã nhận dạng được liên kết với người dùng đó. Nếu sử dụng tính năng Xuất sang BigQuery, bạn cũng phải tự xử lý các yêu cầu xoá của mình tại đó.
Phương thức upsert trả về một Tài nguyên yêu cầu xoá người dùng với trường deletionRequestTime được đặt. Trường deletionRequestTime cho bạn biết thời điểm Google Analytics nhận được yêu cầu xoá.
Sau khi bạn đưa ra yêu cầu xoá, dữ liệu được liên kết với mã nhận dạng người dùng sẽ bị xoá khỏi Báo cáo người dùng cá nhân trong vòng 72 giờ, rồi bị xoá khỏi các máy chủ Analytics trong quy trình xoá tiếp theo. Quy trình xoá được lên lịch diễn ra sau mỗi 2 tháng. Nếu đã xuất dữ liệu người dùng ra bên ngoài Google Analytics, trước tiên bạn nên xoá dữ liệu ở nơi xuất ra.
[[["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: 2024-11-07 UTC."],[[["\u003cp\u003eThe Google Analytics User Deletion API allows you to delete data associated with a specific user ID, helping safeguard user data.\u003c/p\u003e\n"],["\u003cp\u003eData is removed from the Individual User Report within 72 hours of the request and permanently deleted from Analytics servers within two months.\u003c/p\u003e\n"],["\u003cp\u003eThe API requires the \u003ccode\u003ehttps://www.googleapis.com/auth/analytics.user.deletion\u003c/code\u003e OAuth 2.0 scope and utilizes the \u003ccode\u003eupsert\u003c/code\u003e method for deletion requests.\u003c/p\u003e\n"],["\u003cp\u003eSupported user ID types for deletion include \u003ccode\u003eCLIENT_ID\u003c/code\u003e, \u003ccode\u003eUSER_ID\u003c/code\u003e, and \u003ccode\u003eAPP_INSTANCE_ID\u003c/code\u003e, requiring separate requests for each ID associated with a user.\u003c/p\u003e\n"],["\u003cp\u003eIt's crucial to note that the API doesn't remove previously aggregated data or data exported to external platforms like BigQuery, requiring separate deletion processes.\u003c/p\u003e\n"]]],["The Google Analytics User Deletion API allows deletion of user data using the `upsert` method with a `userDeletionRequest`. Specify the user's ID ( `CLIENT_ID`, `USER_ID`, or `APP_INSTANCE_ID`) and its type. Each ID requires a separate request. Data is removed from the Individual User Report within 72 hours and from Analytics servers within two months, but not from aggregated reports or external exports. OAuth 2.0 scope `https://www.googleapis.com/auth/analytics.user.deletion` is necessary.\n"],null,["# Delete user data\n\nThis document explains how you can delete data associated with a given user ID\nusing the Google Analytics User Deletion API. This tool is one of several tools\navailable to help you [safeguard your\ndata](//support.google.com/analytics/answer/6004245).\n| **Important:** The User Deletion API doesn't remove data from reports based on previously aggregated data, such as user counts in the audience overview report, or from other places you may have exported data to, such as BigQuery.\n\nFor more details, see the [reference\ndocumentation](/analytics/devguides/config/userdeletion/v3/reference).\n\nYou can use Firebase projects or Google Analytics properties to send User\nDeletion API requests. The\n**https://www.googleapis.com/auth/analytics.user.deletion** OAuth 2.0 scope is\nrequired for the requests in this guide.\n\nSend a deletion request\n-----------------------\n\nUse the\n[`upsert`](/analytics/devguides/config/userdeletion/v3/reference/userDeletion/userDeletionRequest/upsert)\nmethod to request the data deletion for a given user. The `upsert` method takes\na\n[`userDeletionRequest`](/analytics/devguides/config/userdeletion/v3/reference/userDeletion/userDeletionRequest)\nas its only parameter.\n\nSpecify the user whose data you want to delete by setting one of the IDs inside\nthe `id.userId` field. The type of the ID must be specified inside the `id.type`\nfield.\n\nHere's a list of supported user ID types:\n\n- `CLIENT_ID`: Google Analytics [client\n ID](//support.google.com/analytics/answer/11593727) (only supported when `propertyId` field is set).\n- `USER_ID`: Google Analytics [User\n ID](//firebase.google.com/docs/analytics/userid) (only supported when `propertyId` field is set).\n- `APP_INSTANCE_ID`: Firebase [application instance ID](//firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.html#getAppInstanceId) (only supported when `firebaseProjectId` or `propertyId` field is set).\n\nEach data deletion request processes only the ID submitted in that request.\n\nIf you have multiple IDs associated with the same user, you must submit separate\ndeletion requests for each ID associated with that user. If you Use BigQuery\nexport, you must also process your own deletions there.\n\nLearn more about [user IDs](//support.google.com/analytics/answer/9213390).\n\nDeletion timeline\n-----------------\n\nThe\n[upsert](/analytics/devguides/config/userdeletion/v3/reference/userDeletion/userDeletionRequest/upsert)\nmethod returns a [User Deletion Request\nResource](/analytics/devguides/config/userdeletion/v3/reference/userDeletion/userDeletionRequest)\nwith the `deletionRequestTime` field set. The `deletionRequestTime` field tells\nyou the time at which the deletion request was received by Google Analytics.\n\nOnce deletion is requested, data associated with the user ID will be removed\nfrom the Individual User Report within 72 hours, and then deleted from Analytics\nservers during the next deletion process. Deletion processes are scheduled to\noccur every two months. If you have exported the user data outside of Google\nAnalytics, we recommend you delete it there first."]]