Data Retention Settings #
DMSI Analytics stores event data indefinitely by default. Data retention settings let you automatically archive or delete old events to manage database size.
Accessing Data Retention Settings #
Go to DDLS > Analytics > Settings > Data & Maintenance.
Event Retention Policy #
The event retention policy controls how long raw event records are kept in the wp_dmsilm_analytics_events table.
| Setting | Description |
|---|---|
| Keep Forever (default) | No automatic deletion |
| Archive after N months | Move old events to an archive table |
| Delete after N months | Permanently delete old events |
Impact of Deleting Old Events #
Pre-calculated metrics (in analytics_metrics) are not affected by event deletion. Your charts and reports continue to work correctly after old events are cleaned up.
What is lost when events are deleted:
– The ability to re-run calculations for old periods (if you want to recalculate with different parameters)
– The granular event log used by the Real-Time Dashboard for historical event queries
Recommendation #
For most users, keeping events for 12-24 months provides enough granularity for investigation while preventing unbounded database growth. After 24 months, the events table can become very large on active stores.
Manual Cleanup #
To run event cleanup immediately (outside the monthly schedule):
- Go to DDLS > Analytics > Settings > Data & Maintenance
- Click Run Event Cleanup Now
This applies your configured retention policy immediately.
