Back to Documentation

Database & Raw Data

Your analytics data is stored in a Cloudflare D1 database that you fully own and control. Access it anytime through the Cloudflare dashboard.

Overview

Once Analytics uses a single D1 database to store all events:

  • Pageviews — Every page load
  • Clicks — Button and link clicks
  • Custom events — Any events you track
  • Session data — Derived from visitor hashes

Data is stored in real-time and is immediately queryable.

Exporting data

Run your query in the D1 Console and click Export to download as CSV.

Data retention

D1 doesn't have automatic data retention. To manage storage:

Delete old data

sql
-- Delete events older than 90 days
DELETE FROM events
WHERE created_at < datetime('now', '-90 days');

Check database size

View storage usage in Cloudflare Dashboard → D1 → Your Database → Metrics.

Tip: Cloudflare D1 free tier includes 5GB storage. Most sites won't approach this limit for months or years of data.


Questions? Email hello@onceanalytics.com