feat: site analytics client — traffic analysis like Google Analytics #219

Open
opened 2026-06-20 17:46:54 +00:00 by jmiller · 1 comment
Owner

Summary

MokoSuiteClient needs a built-in analytics client that provides Google Analytics-style traffic analysis without requiring a third-party service. All data stays on the site or is sent to MokoSuiteClientHQ for aggregated dashboards.

Requirements

Data Collection (Frontend Plugin)

  • Page views (URL, title, referrer, timestamp)
  • Unique visitors (hashed IP + UA fingerprint, no PII)
  • Session tracking (session ID, duration, page count)
  • Traffic sources (referrer domain, UTM parameters, direct/organic/social)
  • Device/browser detection (UA parsing — device type, browser, OS)
  • Geographic location (via DB-IP integration already in MokoSuiteClient)
  • Bounce rate calculation (single-page sessions)
  • Entry/exit pages

Storage

  • Dedicated database tables for raw hits + daily aggregates
  • Automatic data retention / pruning (configurable, e.g. 90 days raw, 2 years aggregated)
  • Lightweight — must not degrade site performance

Reporting (Admin Dashboard)

  • Visitors over time (daily/weekly/monthly charts)
  • Top pages, top referrers, top search terms
  • Traffic source breakdown (direct, organic, social, referral)
  • Device/browser/OS breakdown
  • Geographic map or country breakdown
  • Real-time active visitors count
  • Comparison periods (this week vs last week)

Privacy

  • No cookies required (fingerprint-based, GDPR-friendly)
  • Respect Do Not Track header (configurable)
  • IP anonymization (hash, never store raw)
  • Bot/crawler filtering (exclude known bots from stats)

HQ Integration

  • Send daily aggregates to MokoSuiteClientHQ via heartbeat
  • HQ dashboard shows analytics across all managed sites

Architecture

  • plg_system_mokosuiteclient_analytics — frontend hit collector (lightweight JS-free server-side tracking)
  • Component views in com_mokosuiteclient — analytics dashboard with charts
  • plg_task_mokosuiteclient_analytics — scheduled aggregation + pruning task
  • Database tables: #__mokosuiteclient_analytics_hits, #__mokosuiteclient_analytics_daily

Prior Work

A MokoSuiteAnalytics repo previously existed but was deleted. This feature should be built directly into MokoSuiteClient as a core component.

## Summary MokoSuiteClient needs a built-in analytics client that provides Google Analytics-style traffic analysis without requiring a third-party service. All data stays on the site or is sent to MokoSuiteClientHQ for aggregated dashboards. ## Requirements ### Data Collection (Frontend Plugin) - Page views (URL, title, referrer, timestamp) - Unique visitors (hashed IP + UA fingerprint, no PII) - Session tracking (session ID, duration, page count) - Traffic sources (referrer domain, UTM parameters, direct/organic/social) - Device/browser detection (UA parsing — device type, browser, OS) - Geographic location (via DB-IP integration already in MokoSuiteClient) - Bounce rate calculation (single-page sessions) - Entry/exit pages ### Storage - Dedicated database tables for raw hits + daily aggregates - Automatic data retention / pruning (configurable, e.g. 90 days raw, 2 years aggregated) - Lightweight — must not degrade site performance ### Reporting (Admin Dashboard) - Visitors over time (daily/weekly/monthly charts) - Top pages, top referrers, top search terms - Traffic source breakdown (direct, organic, social, referral) - Device/browser/OS breakdown - Geographic map or country breakdown - Real-time active visitors count - Comparison periods (this week vs last week) ### Privacy - No cookies required (fingerprint-based, GDPR-friendly) - Respect Do Not Track header (configurable) - IP anonymization (hash, never store raw) - Bot/crawler filtering (exclude known bots from stats) ### HQ Integration - Send daily aggregates to MokoSuiteClientHQ via heartbeat - HQ dashboard shows analytics across all managed sites ## Architecture - `plg_system_mokosuiteclient_analytics` — frontend hit collector (lightweight JS-free server-side tracking) - Component views in `com_mokosuiteclient` — analytics dashboard with charts - `plg_task_mokosuiteclient_analytics` — scheduled aggregation + pruning task - Database tables: `#__mokosuiteclient_analytics_hits`, `#__mokosuiteclient_analytics_daily` ## Prior Work A MokoSuiteAnalytics repo previously existed but was deleted. This feature should be built directly into MokoSuiteClient as a core component.
Author
Owner

Branch created: feature/219-feat-site-analytics-client-traffic-analy

git fetch origin
git checkout feature/219-feat-site-analytics-client-traffic-analy
Branch created: [`feature/219-feat-site-analytics-client-traffic-analy`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteClient/src/branch/feature/219-feat-site-analytics-client-traffic-analy) ```bash git fetch origin git checkout feature/219-feat-site-analytics-client-traffic-analy ```
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteClient#219