Sub topic 4
Reset user data on new activity
This chapter covers the second control in the Data retention settings: the Reset user data on new activity toggle. It assumes you know where the Admin area is, what an event, a parameter and a user are in GA4, and that you have read the previous chapter on choosing an event data retention period. You will learn what the toggle changes, what it leaves alone, how to model its effect on a user's data, and how to read and set it through the Admin API.
What the toggle does
The event data retention setting defines how long GA4 keeps user-level and event-level data. That data is tied to identifiers such as cookies, User-ID values and advertising identifiers. Standard properties choose between 2 months and 14 months. The reset toggle decides when that clock starts counting.
- On: each time a user generates new activity, the retention clock for that user's data restarts. The data expires only after the user has been inactive for the full retention period.
- Off: the clock is not restarted by later activity. Each piece of event data is removed once the retention period has passed since it was collected.
New properties start with a 2-month retention period and the toggle on. These defaults are a common reason teams find their Explorations cannot look back as far as they expected.
You find both controls in Admin > Data collection and modification > Data retention for the property. Changing them requires the Editor role or higher on the property.
A worked example
Take a property with 2-month retention. One user triggers events on 1 January and again on 15 February, then never returns.
- Toggle on: the 15 February activity restarts the clock. All of this user's data, including the 1 January events, is kept until about 15 April.
- Toggle off: the 1 January events expire around 1 March. The 15 February events expire around 15 April.
You can model this with a short script. It uses calendar months so it handles month ends, and it models the rule only. Google deletes data in scheduled processing, so real removal can lag the computed date.
import calendar
from datetime import date
def add_months(d, n):
m = d.month - 1 + n
y = d.year + m // 12
m = m % 12 + 1
day = min(d.day, calendar.monthrange(y, m)[1])
return date(y, m, day)
def expiry(events, months, reset_on):
if reset_on:
# One clock for the user: it restarts at the latest activity.
return {"all user data": add_months(max(events), months)}
# No restart: each event expires on its own schedule.
return {e.isoformat(): add_months(e, months) for e in events}
events = [date(2026, 1, 1), date(2026, 2, 15)]
print("reset on :", expiry(events, 2, True))
print("reset off:", expiry(events, 2, False))The output shows one expiry date of 2026-04-15 for the whole user when reset is on. When reset is off, it shows 2026-03-01 for the first event and 2026-04-15 for the second.
Choosing between on and off
The two settings suit different goals, and the right choice depends on what you want to analyze and how strict your privacy policy is.
| Concern | Reset on | Reset off |
|---|---|---|
| Returning users | Their history stays available while they remain active | Their older events still expire on schedule |
| Long-term loyalty or lifecycle analysis | Better, because active users keep their history | Limited to the retention window |
| Data minimization | Weaker, because active users' data can persist indefinitely | Stronger, because no event outlives the period |
| Predictability for compliance | Expiry depends on user behavior | Expiry is a fixed date per event |
If your policy says "we keep no individual-level event data longer than 14 months", turn the toggle off. With the toggle on, a user who visits every few weeks keeps their earliest events for as long as they stay active. That can break such a policy.
If you analyze cohorts or user journeys over many months and your policy allows it, leave the toggle on.
What the setting does not touch
The retention controls apply to user-level and event-level data. They do not affect these:
- Standard reports such as the Reports snapshot, Acquisition and Engagement. These are built from aggregated data and are unaffected by retention or by the reset toggle.
- Data already exported to BigQuery. The export is a separate copy that you control. The later chapter on BigQuery export covers it as a long-term archive.
The setting does affect:
- Explorations. The date range you can query is limited by how much event data remains.
- Segments and audiences defined on user-level history. The history available to evaluate conditions is limited by retention.
The next chapter covers these effects in detail. For now, remember that the reset toggle changes which users keep deep history, so Explorations can show long histories for active users and short ones for lapsed users in the same report.
Common errors
- Assuming a longer period applies to old data. Retention applies to data that still exists. If the property ran at 2 months for a year, switching to 14 months does not recover the earlier data.
- Expecting standard reports to shrink. Aggregated reports do not change when you shorten retention. If a number disappears from an Exploration but not from a standard report, retention is the likely cause.
- Treating the toggle as a user-count control. It does not change how many users are counted. It changes how long the underlying records survive.
- Reading expiry as instant. Deletion happens in scheduled processing, so data can remain a short while past the computed date. Do not use the toggle as proof of deletion at a precise moment. For erasure on request, use a data deletion request, covered in a later chapter.
- Forgetting that the setting is per property. A website property and an app property can have different values, and so can your test and production properties.
Reading and changing the toggle with the Admin API
The Admin API exposes both settings on the dataRetentionSettings resource. The field resetUserDataOnNewActivity is a boolean, and eventDataRetention is an enum such as TWO_MONTHS or FOURTEEN_MONTHS. The token needs an Analytics edit scope, such as https://www.googleapis.com/auth/analytics.edit, for the PATCH call.
# Read the current settings for property 123456789
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
"https://analyticsadmin.googleapis.com/v1beta/properties/123456789/dataRetentionSettings"
# Keep 14-month retention but turn the reset off,
# so no event outlives 14 months
curl -s -X PATCH \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"eventDataRetention":"FOURTEEN_MONTHS","resetUserDataOnNewActivity":false}' \
"https://analyticsadmin.googleapis.com/v1beta/properties/123456789/dataRetentionSettings?updateMask=eventDataRetention,resetUserDataOnNewActivity"The updateMask lists exactly the fields you intend to change. Fields you leave out of the mask keep their current values, even if they appear in the body. The response returns the full resource, so you can confirm the new values without a second call. A later chapter shows how to script this across many properties.
Practical checklist
- Open Admin > Data collection and modification > Data retention and note both values.
- Compare them with your written policy. Decide whether it allows data to persist for active users.
- If you need history beyond the retention window, confirm that a BigQuery export is running before you shorten anything.
- After changing the settings, build a quick Exploration over a long date range and confirm the lookback matches what you expect.
- Record the change, the date and the reason in your documentation.
Exercise
A property has 14-month retention and the reset toggle on. A user's first event was 20 months ago, and the user visited again last week. Is that first event still available in Explorations? What changes if the toggle is turned off?
Show answer
With the toggle on, last week's activity restarted the clock, so the user's data, including the first event, remains available because the user has not been inactive for 14 months. With the toggle off, each event expires 14 months after it was collected, so the event from 20 months ago is removed (once deletion processing runs) regardless of the recent visit. Note that data already deleted would not return if the toggle were later switched back on.
Exercise
Your privacy policy says no individual-level event data may be kept longer than 14 months. Which retention period and toggle value satisfy it, and which API call sets them?
Show answer
Use FOURTEENMONTHS (or TWOMONTHS) with resetUserDataOnNewActivity set to false. A PATCH request to properties/PROPERTYID/dataRetentionSettings with the body {"eventDataRetention":"FOURTEENMONTHS","resetUserDataOnNewActivity":false} and updateMask=eventDataRetention,resetUserDataOnNewActivity sets them. With the toggle on, an active user's early events could be kept beyond 14 months.