Sub topic 12
Data deletion requests
This chapter covers how to remove data from a GA4 property on purpose. It assumes you know the GA4 Admin area, events, parameters and user properties, and why consent matters under rules such as GDPR. It also assumes you have read the earlier chapters on retention periods and BigQuery export.
Deletion versus retention
Event data retention is automatic and applies to a whole property. When the retention period ends, GA4 expires user-level data on its own schedule. You can't target one parameter or one person with it.
A data deletion request is manual and targeted. You tell GA4 exactly what to remove, and GA4 removes it before retention would have. Typical reasons:
- You collected something you should not have, such as an email address in a page URL or an event parameter.
- A visitor withdraws consent or asks for erasure, and you must remove their records.
- A tagging bug sent the wrong values for a period, and you want them gone.
| Question | Retention setting | Deletion request |
|---|---|---|
| Who starts it? | GA4, on a schedule | You |
| Scope | Whole property | Chosen data, date range, or identifier |
| Timing | Continuous | Grace period, then processing |
| Reversible? | Not for expired data | Only during the grace period |
Two ways to request deletion
GA4 offers two routes, and they solve different problems.
- Property-level deletion in the Admin area. You find it under Admin, Data collection and modification, Data deletion requests. You pick what to delete and the date range it covers. This route suits bulk problems such as a leaked parameter.
- User-level deletion through the User Deletion API. You send one identifier, either a client ID, a user ID or an app instance ID, and GA4 removes the data tied to it. This route suits an erasure request from one person.
Check your role before you start. The Admin route needs a property role that can edit data collection settings, which is normally Editor or higher. Confirm the current requirement in Google's documentation, because role names and the UI layout change.
Property-level deletion
When you create a request in the Admin area, you make three choices:
- What to delete. You can target specific data fields, such as an event parameter or a user property. You can also target a whole event name, which removes more than you may intend.
- When. You choose a date range. Only data collected inside that range is affected.
- Which property. The request applies only to the property you are in.
Prefer the narrowest target that fixes the problem. If a form_submit event carried an email address in a parameter called form_email, delete that parameter. Don't delete the whole event, because you would lose a conversion event's history as well.
Lifecycle of a request
A request does not run immediately. It sits in a scheduled state during a grace period. The grace period gives you a chance to catch a mistake. After it ends, the deletion runs. Google documents that the data is then removed from its servers within a further window, which is currently stated as up to about two months. Confirm the exact numbers in the current help page, because they are policy values and can change.
What a deletion request does not touch
Deletion acts on the data stored in the GA4 property. Copies elsewhere stay as they are, and this is the most common compliance gap.
- BigQuery export. Rows already exported to your BigQuery dataset are your data, in your project. GA4 does not remove them. You must delete or update those rows yourself, for example with a SQL
DELETEor by dropping the affected date-sharded tables. This follows from the BigQuery archive chapter: the archive that preserves history beyond retention also preserves the data you wanted gone. - Linked products. Data already passed to Google Ads or other linked products, and audiences already built from it, follows those products' own rules. Check their settings separately.
- Third-party copies. Spreadsheets, dashboards, Looker Studio extracts and data warehouse copies are outside Google's reach.
Deleting one user's data with the User Deletion API
For an erasure request from one person, you first need the identifier GA4 holds for them. Which identifier you use depends on how your site collects data:
USER_IDif you send a user ID withgtag('config', ...)or the Measurement Protocol.CLIENT_IDfor web visitors identified only by the first-party cookie. The value sits in the_gacookie, and you can often read it from an event parameter you've registered.APP_INSTANCE_IDfor mobile app installs.
The request needs an OAuth token with the https://www.googleapis.com/auth/analytics.user.deletion scope. The call below uses the same style as the earlier Admin API example.
# Delete data for one client ID from GA4 property 123456789
curl -s -X POST \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"kind": "analytics#userDeletionRequest",
"id": {
"type": "CLIENT_ID",
"userId": "1234567890.1700000000"
},
"propertyId": "123456789"
}' \
"https://www.googleapis.com/analytics/v3/userDeletion/userDeletionRequests:upsert"The API returns a deletion request time, which you should record as proof that you acted. Treat the userId field as the identifier value for whichever type you chose, even though the field name suggests only user IDs.
Deletion and consent
Consent mode and deletion cover different moments in the data's life.
- Before collection. Consent mode, set with
gtag('consent', 'default', ...), controls what GA4 may store. Ifanalytics_storageisdenied, GA4 does not set analytics cookies for that visit. It may still receive cookieless pings that GA4 uses for modeling. - After collection. Deletion removes data that was already stored.
Withdrawal of consent often needs both. Updating the consent state stops further collection for that visitor. It does not erase what you collected while they had granted consent. If your policy or the law requires erasure on withdrawal, you must also submit a deletion request for their identifier.
// Visitor withdraws consent in your banner: stop future collection.
gtag('consent', 'update', {
analytics_storage: 'denied',
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied'
});
// Erasure of past data is a separate step, done server-side with
// the User Deletion API using this visitor's client ID.Keep the deletion call on your server. The access token must never ship in browser code.
How deletion relates to retention, signals and thresholding
- Retention. If a retention period is short, some data may expire before you act. Deletion is still worth doing for data inside the window, and for anything you archived.
- Google signals. Data tied to signed-in Google users may also be linked to identifiers other than the client ID. Deleting by client ID covers the GA4 record. Check what your privacy policy promises about linked identifiers.
- Thresholding. After you delete data, small remaining counts may fall under thresholds, so some rows may be hidden in reports. This is expected behavior, not a fault.
Common errors
- Deleting the whole event instead of one parameter. You lose counts for a conversion event. Target the parameter.
- Wrong date range. The range covers only data collected in it. A leak that began three months ago needs a range that reaches back that far.
- Forgetting BigQuery. GA4 shows the data gone while the export still holds it.
- Using the wrong identifier type. A client ID submitted as
USER_IDmatches nothing, and the request will not erase the intended record. - Missing the grace period. After it ends you can't cancel.
- No record. Auditors ask when you acted. Save the request ID, date and scope.
A short runbook
- Identify the data: field name, event, date range, or person.
- Decide the route: Admin deletion for bulk fields, User Deletion API for a person.
- Have a second person review the scope.
- Submit the request and record the confirmation.
- Delete matching rows in BigQuery and other copies you control.
- After the completion window, verify with a report or query that the data is gone.
- Log everything in your privacy audit file for the settings review in the final chapter.
Exercise
A tagging bug sent customer email addresses in an event parameter named form_email on your form_submit event for the last 40 days. Your property exports to BigQuery daily. Describe the deletion steps and name the one place GA4's deletion will not clean.
Show answer
Create a property-level deletion request in Admin, Data collection and modification, Data deletion requests. Target only the form_email parameter, not the whole form_submit event, and set a date range that covers all 40 days. Have someone review it during the grace period, since you can cancel only then. Also fix the tag so the bug stops. GA4's deletion will not clean the BigQuery export, so you must remove or null out form_email in the exported tables yourself, and you should check any dashboards or extracts that copied it.
Exercise
A visitor withdraws consent and asks you to erase their data. Which two actions do you take, and why is the consent update alone not enough?
Show answer
First, update consent to denied so no new data is collected for that visitor. Second, submit a User Deletion API request with their identifier, such as the client ID, to remove data already stored. The consent update only affects future collection. It does not erase data collected while consent was granted.