Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questo documento spiega come eliminare i dati associati a un determinato ID utente utilizzando l'API User Deletion di Google Analytics. Questo è uno dei diversi strumenti disponibili per aiutarti a salvaguardare i tuoi dati.
Puoi utilizzare i progetti Firebase o le proprietà Google Analytics per inviare richieste all'API UserDeletion. L'ambito OAuth 2.0 https://www.googleapis.com/auth/analytics.user.deletion è obbligatorio per le richieste in questa guida.
Inviare una richiesta di eliminazione
Utilizza il metodo upsert per richiedere l'eliminazione dei dati per un determinato utente. Il metodo upsert utilizza
userDeletionRequest
come unico parametro.
Specifica l'utente di cui vuoi eliminare i dati impostando uno degli ID all'interno del campo id.userId. Il tipo di ID deve essere specificato all'interno del campo id.type.
Ecco un elenco dei tipi di ID utente supportati:
CLIENT_ID: ID cliente di Google Analytics (supportato solo se è impostato il campo propertyId).
USER_ID: ID
utente di Google Analytics (supportato solo se è impostato il campo
propertyId).
APP_INSTANCE_ID: ID istanza dell'applicazione Firebase
(supportato solo quando è impostato il campo firebaseProjectId o propertyId).
Ogni richiesta di eliminazione dei dati elabora solo l'ID inviato al suo interno.
Se hai più ID associati allo stesso utente, devi inviare richieste di eliminazione separate per ogni ID associato a quell'utente. Se utilizzi BigQuery
export, devi elaborare anche le tue eliminazioni.
Il metodo
upsert
restituisce una risorsa
Richiesta di eliminazione utente
con il campo deletionRequestTime impostato. Il campo deletionRequestTime indica
la data e l'ora in cui la richiesta di eliminazione è stata ricevuta da Google Analytics.
Una volta richiesta l'eliminazione, i dati associati all'ID utente verranno rimossi dal report del singolo utente entro 72 ore, per poi essere eliminati dai server Analytics durante il successivo processo di eliminazione. Questi processi sono pianificati in modo da avvenire ogni due mesi. Se hai esportato i dati utente al di fuori di Google
Analytics, ti consigliamo di eliminarli da lì.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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."]]