Heratio Help Center article. Category: Admin & Settings.

Usage Statistics

User Guide

Track page views, downloads, and visitor analytics with geographic data, bot filtering, and comprehensive reporting dashboards.


Overview

USAGESTATISTICSVIEWSDOWNLOADSVISITORSGEOGRAPHYPageFileUniqueCountryVisitsDownloadsUsersLocationDASHBOARDS&REPORTS

Key Features

STATISTICSFEATURES📊PAGEVIEWTRACKING•Automatictrackingofrecordviews•Trackviewsbyrepositoryanditem•Uniquevisitorcounting📥DOWNLOADTRACKING•Trackfiledownloads•Digitalobjectdownloadcounts•Topdownloadeditemsreports🌍GEOGRAPHICDATA•Visitorlocationbycountry•City-leveldata(withGeoIP)•Regionaldistributionmaps🤖BOTFILTERING•Automaticbot/spiderdetection•30pre-configuredpatterns•Custombotrules📈DASHBOARDS&REPORTS•Interactivecharts•Daterangefiltering•CSVexportforallreports⚡PRE-AGGREGATION•Dailyandmonthlyrollups•Fastdashboardperformance•Configurableretention

How to Access

MainMenuAdminStatisticsDashboard(overview&charts)Views(pageviewtrends)Downloads(downloadstatistics)TopItems(mostpopular)Geographic(visitorlocations)Settings(configuretracking)

Dashboard

Main Statistics Dashboard

STATISTICSDASHBOARDPeriod:[Last30Days]From:[2026-01-01]To:[2026-01-30]TotalViewsDownloadsVisitors24,5673,4218,23412.5%8.3%15.2%VIEWSOVERTIME1500╱╲╱╲╱╲╱╲1000╱╲╱╲╱╲╱╲╱╲500╱╲╱╲0Jan1Jan15Jan30TOP5ITEMSTOPCOUNTRIESHistoricalPhotos2,341SouthAfrica45.2%CouncilMinutes19501,876USA18.7%MapsCollection1,234UK12.3%FamilyArchives987Germany5.8%HeritageBuilding654Australia4.2%

Views Report

Viewing Page Statistics

Go to Statistics → Views

VIEWSREPORTPeriod:[2026-01-01]to[2026-01-30]Groupby:[Daily][Apply]VIEWSCHARTTotalViewsUniqueVisitors1200╱╲800╱╲╱╲╱╲╱╲400╱╲__╱╲___0W1W2W3W4DATATABLEPeriodTotalUnique2026-01-018564232026-01-029235122026-01-031,1026342026-01-04789401.........[ExportCSV]

Downloads Report

Tracking File Downloads

Go to Statistics → Downloads

DOWNLOADSREPORTPeriod:[2026-01-01]to[2026-01-30][Apply]DOWNLOADSOVERTIMETOPDOWNLOADEDITEMS#TitleDownloads▓▓▓▓▓▓1AnnualReport.pdf523▓▓▓▓▓▓▓▓2PhotoAlbum.zip412▓▓▓▓▓▓▓▓▓▓3HeritageMap.tif387▓▓▓▓▓▓▓▓▓▓▓▓4CouncilMinutes.pdf298▓▓▓▓▓▓▓▓▓▓▓▓5AudioRecording.mp3245W1W2W3W4W5W6[ExportCSV]

Top Items Report

Most Viewed Records

Go to Statistics → Top Items

TOPITEMSPeriod:[2026-01-01]to[2026-01-30]Type:[Views]Limit:[50][Apply]#TitleRepositoryViews1HistoricalPhotographs1920-1950CityArch2,3412CouncilMinutesVolume1MuniArch1,8763MapsoftheCapeColonyNatArch1,2344SmithFamilyPapersPrivate9875HeritageBuildingPlansCityArch6546NewspaperClippingsCollectionLibrary6237AudioRecordings1960sNatArch5898LettersandCorrespondencePrivate5349MilitaryRecordsWW2DefArch47810ChurchRegistersChurch423Showing1-10of50[ExportCSV]

Geographic Report

Visitor Locations

Go to Statistics → Geographic

GEOGRAPHICSTATISTICSPeriod:[2026-01-01]to[2026-01-30][Apply]VISITORSBYCOUNTRYSouthAfrica████████████████████████████████████45.2%USA█████████████████18.7%UK████████████12.3%Germany█████5.8%Australia████4.2%Netherlands███3.1%Canada██2.4%France██2.1%Other█████6.2%DETAILEDDATACountryVisitorsViewsDownloadsSouthAfrica3,72111,2341,543USA1,5394,632624UK1,0123,045412Germany4771,432198Australia3451,038143[ExportCSV]

Note: Geographic data requires MaxMind GeoLite2 database. See Settings for setup.


Repository Statistics

Per-Repository Reports

Click on any repository name to view detailed statistics:

REPOSITORY:CityArchivesPeriod:[2026-01-01]to[2026-01-30]TotalViewsDownloadsVisitors8,4561,2342,567TOPITEMSINTHISREPOSITORY#TitleViews1HistoricalPhotographs1920-19502,3412HeritageBuildingPlans6543StreetMapsCollection5234CouncilCorrespondence1940s4125PublicWorksDocuments387

Settings

Configure Statistics

Go to Statistics → Settings

STATISTICSSETTINGSTRACKINGOPTIONS☑Trackpageviews☑Trackdownloads☑Trackuniquevisitors☐TracksearchqueriesBOTFILTERING☑Enablebotfiltering☑Logfilteredrequests(fordebugging)[ManageBotList](30patternsconfigured)PRIVACY☑AnonymizeIPaddresses(GDPRcompliance)Retention:[90]daysforraweventsGEOIPDatabasePath:/usr/share/GeoIP/GeoLite2-City.mmdbStatus:✓Installed(Lastupdated:2026-01-15)[TestGeoIP][UpdateDatabase][SaveSettings]

Bot Filtering

Managing Bot Patterns

Go to Statistics → Settings → Manage Bot List

BOTFILTERLISTCONFIGUREDPATTERNSNamePatternCategoryStatusGooglebotGooglebotgooglebotSearch✓OnBingbotbingbotmsnbotSearch✓OnYandexYandexBotSearch✓OnFacebookfacebookexternalhitSocial✓OnTwitterTwitterbotSocial✓OnArchive.orgarchive.org_botArchive✓OnSEMrushSemrushBotSEO✓On............ADDNEWPATTERNName:[________________]Pattern:[________________](regex)Category:[Crawler][AddPattern]

Exporting Data

CSV Export

All reports support CSV export for external analysis:

EXPORTOPTIONSReportType:[Views]DateRange:From:[2026-01-01]To:[2026-01-30]GroupBy:○Day○Week●MonthInclude:☑Totalviews☑Uniquevisitors☑Countrybreakdown☐Item-leveldetail[DownloadCSV]

CLI Commands

Aggregate Statistics

# Run all aggregations (recommended for daily cron)
php artisan ahg:statistics-aggregate --all

# Daily aggregation only
php artisan ahg:statistics-aggregate --daily

# Monthly aggregation
php artisan ahg:statistics-aggregate --monthly

# Cleanup old raw events (keep 90 days)
php artisan ahg:statistics-aggregate --cleanup --days=90

# Backfill aggregates from a start date (Y-m-d)
php artisan ahg:statistics-aggregate --backfill=2026-01-01

Generate Reports

# Summary report (default)
php artisan ahg:statistics-report

# Detailed report
php artisan ahg:statistics-report --type=detailed

# Trends report
php artisan ahg:statistics-report --type=trends

# Limit the number of rows
php artisan ahg:statistics-report --type=detailed --limit=100

# Custom date range
php artisan ahg:statistics-report --start=2026-01-01 --end=2026-01-31

# Export to CSV
php artisan ahg:statistics-report --type=detailed --format=csv --output=/tmp/stats.csv

# JSON output
php artisan ahg:statistics-report --type=summary --format=json

Cron Setup

# Aggregate daily statistics at 2am
0 2 * * * cd /usr/share/nginx/heratio && php artisan ahg:statistics-aggregate --daily

# Monthly aggregation on 1st of month at 3am
0 3 1 * * cd /usr/share/nginx/heratio && php artisan ahg:statistics-aggregate --monthly

# Weekly cleanup of old raw events (Sunday 4am)
0 4 * * 0 cd /usr/share/nginx/heratio && php artisan ahg:statistics-aggregate --cleanup

GeoIP Setup

Installing MaxMind GeoLite2

  1. Register for a free account:

  2. Download the database:

    • Download: GeoLite2-City.mmdb
  3. Install the database:

    # Create directory
    sudo mkdir -p /usr/share/GeoIP
    
    # Copy database
    sudo cp GeoLite2-City.mmdb /usr/share/GeoIP/
    
    # Set permissions
    sudo chmod 644 /usr/share/GeoIP/GeoLite2-City.mmdb
    
  4. Verify in Settings:

    • Go to Statistics → Settings
    • GeoIP status should show "Installed"

Understanding the Data

How Statistics Are Collected

DATACOLLECTIONFLOWUservisitspageBotCheckBotdetectedEventloggedbutexcludedHumanGeoIPLookuplocationfromIPLookupRAWEVENTSTORED•ObjectID,Type•IPAddress(anonymizedifconfigured)•UserAgent•Country,City•TimestampNightlyaggregationDAILY/MONTHLYAGGREGATES•Totalviewsperday/month•Uniquevisitors•Per-objecttotals•Per-countrytotals

Data Retention

DATARETENTIONRAWEVENTS(ahg_usage_event)Retained:90days(configurable)Then:DeletedbycleanupjobDAILYAGGREGATES(ahg_statistics_daily)Retained:IndefinitelySmallfootprint,fastqueriesMONTHLYAGGREGATES(ahg_statistics_monthly)Retained:IndefinitelyLong-termtrendanalysis

Troubleshooting

Issue Solution
No statistics showing Check if tracking is enabled in Settings
Bot traffic included Enable bot filtering, update bot patterns
No geographic data Install MaxMind GeoLite2 database
Dashboard slow Run php artisan ahg:statistics-aggregate --all to build aggregates
Data not current Ensure daily cron job is running
Export fails Check write permissions on export directory

Privacy Compliance

GDPR/POPIA Features

PRIVACYFEATURES✓IPAnonymization•StoreshashedIPsinsteadofrawaddresses•Cannotbereversedtoidentifyindividuals✓ConfigurableRetention•Sethowlongraweventsarekept•Automaticcleanupviacronjob✓Aggregate-OnlyReporting•Reportsshowtotals,notindividualvisits•Nopersonaldatainexports✓BotFiltering•Excludesautomatedtraffic•Moreaccuratehumanvisitorcounts

  • Audit Trail - Track who accessed what
  • Privacy Plugin - Data subject requests
  • Reports Dashboard - General reporting