Generate aggregate metrics for reporting and analytics dashboards. Provides breakdown by user type, authentication status, and time period. Use this for executive summaries, investor reports, or trend analysis. Optionally filter to a specific date range for period-over-period comparisons.
Arguments
- start_date
Date or POSIXct or NULL. Start of filter range (inclusive). If NULL, includes all downloads from the beginning of time. Combine with
end_dateto analyze specific periods (e.g., monthly reports).- end_date
Date or POSIXct or NULL. End of filter range (inclusive). If NULL, includes all downloads through the present. Use
Sys.Date()for "up to today" queries.- cn
DBI connection object or NULL. Database connection from
artcore::dbc("artsite"). If NULL (default), creates and closes connection automatically.
Value
List with named elements containing aggregate statistics:
total_downloads: Integer total download count in the periodunique_emails: Integer count of unique email addressesby_user_type: Data frame with columnsuser_typeandcountauthenticated: Integer count of logged-in user downloadsanonymous: Integer count of anonymous downloadsdate_range: List withstartandendvalues used for the query
