--- url: "https://developers.google.com/analytics/devguides/config/userdeletion/migration" titulek: "Migrate to the Google Analytics Admin API for user deletion | Google for Developers" h1: "Migrate to the Google Analytics Admin API for user deletion Stay organized with collections Save and categorize content based on your preferences." popis: "" jazyk: "en" kanonicka: "https://developers.google.com/analytics/devguides/config/userdeletion/migration" drobecky: ["Google Analytics", "Migrate to the Google Analytics Admin API for user deletion"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 21:47:57" znaku: 3180 slov: 396 kodovani: "iso-8859-2" sha256: "3589eab6018b08d1a716afa7efcb162c5395d6cf75fe0091ab63bc87e01157ee" --- Migrate to the Google Analytics Admin API for user deletion Stay organized with collections Save and categorize content based on your preferences. The legacy Google Analytics User Deletion API (v3) has been sunset along with Universal Analytics. The Google Analytics Admin API (v1alpha) provides a replacement [`SubmitUserDeletion`](/analytics/devguides/config/admin/v1/rest/v1alpha/properties/submitUserDeletion) method to request data deletion for users in Google Analytics properties. Do I need to migrate? If your code is still calling the `upsert` method of the legacy User Deletion API (v3), you must migrate to the Google Analytics Admin API to perform user deletions for your Google Analytics properties. Migration steps Follow these steps to start using the new `SubmitUserDeletion` method. Enable the Google Analytics Admin API Click the following **Enable the Google Analytics Admin API** button to select or create a new project and automatically enable the Google Analytics Admin API. Find and replace calls to the legacy User Deletion API Replace any calls to the legacy `upsert` method of the legacy User Deletion API with calls to the new [`SubmitUserDeletion`](/analytics/devguides/config/admin/v1/rest/v1alpha/properties/submitUserDeletion) method of the Google Analytics Admin API. Example `upsert` request to the legacy User Deletion API: REST`POST https://analytics.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert { "propertyId": "1234567", "id": { "type": "USER_ID", "userId": "user123" } }` Example of an equivalent `SubmitUserDeletion` request of the Google Analytics Admin API: REST`POST https://analyticsadmin.googleapis.com/v1alpha/properties/1234567:submitUserDeletion { "userId": "user123" }` Update requested OAuth scopes The new `SubmitUserDeletion` of the Google Analytics Admin API uses the scope `https://www.googleapis.com/auth/analytics.edit`. This is different from the legacy User Deletion API, which used the `https://www.googleapis.com/auth/analytics.user.deletion` scope. You should update any code or access token request commands that are using `https://www.googleapis.com/auth/analytics.user.deletion` to request `https://www.googleapis.com/auth/analytics.edit` instead. If you are using a client library, it should request the necessary scopes automatically. Disable the legacy API Once you have updated your code to use the `SubmitUserDeletion` method, you are ready to disable the legacy API in your Google Cloud project. Open the [following link](//console.cloud.google.com/apis/api/analytics.googleapis.com/metrics) to open the legacy Universal Analytics API endpoint in your Google Cloud Console. Select your Cloud Project and click the **Disable API** button. Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates. Last updated 2026-09-10 UTC.