SiteStats
Public-facing visitor stats for end users. Unlike the Analytics plugin, which sends operator analytics to providers such as GA4 or Naver Analytics, SiteStats renders activity indicators directly on the site.
Statusβ
| Key | Value |
|---|---|
| Layer | composite |
| Tier | L1 |
| Status | wip |
| Version | 0.1.0 |
| Price | Free |
| Category | Social |
Analytics Boundaryβ
| Plugin | Purpose | Data flow |
|---|---|---|
Analytics | Operator analytics | Export to GA4, Naver Analytics, or custom providers |
SiteStats | Public display | Self-aggregate in Redis and render on the site |
SiteStats is not a conversion analytics or advertising measurement plugin. It is for social proof: current visitors, today's visitors, total visitors, popular pages, and live visitor status.
Feature Togglesβ
| Feature | Description |
|---|---|
counters | Current / today / total visitors |
popular_pages | Top N popular pages |
live_feed | Live visitor feed |
dwell_time | Optional dwell-time helper metric |
content_top | Future top-content adapter |
Install / Activationβ
The project composer.json must include the SiteStats PSR-4 mappings.
"App\\Plugins\\SiteStats\\": "app/Plugins/SiteStats/src/",
"App\\Plugins\\SiteStats\\Database\\": "app/Plugins/SiteStats/database/",
"App\\Plugins\\SiteStats\\Tests\\": "app/Plugins/SiteStats/tests/"
When the provider is enabled, routes, views, translations, config, and migrations are registered.
App\Plugins\SiteStats\Providers\SiteStatsServiceProvider::class
Blade Usageβ
Add the beacon once before </body>.
<x-sitestats::beacon />
Place display widgets wherever the site should show them.
<x-sitestats::current />
<x-sitestats::today />
<x-sitestats::total />
<x-sitestats::popular :limit="10" />
<x-sitestats::live />
Visitor Country / Locale Displayβ
SiteStats can store the request-scoped visitor.context produced by Core in the live feed payload.
| Field | Meaning |
|---|---|
country_code | Country code such as KR or JP |
country_source | Default source, usually cloudflare |
locale_hint | Locale inferred from country |
resolved_locale | Locale actually applied to the request |
is_estimated | Whether the value is IP-based estimation |
When Cloudflare proxying is enabled, Core reads CF-IPCountry. If the header is missing or unmapped, SiteStats silently falls back to the existing live feed display.
Example:
Guest JP Β· ja /bible
IP country is only an estimate. Do not use it for security, authorization, billing, or tenant decisions.
Related Core Settingsβ
CORE_VISITOR_COUNTRY_DETECTION=true
CORE_VISITOR_COUNTRY_HEADER=CF-IPCountry
CORE_VISITOR_COUNTRY_SOURCE=cloudflare
The country-based locale hint has lower priority than explicit ?lang, user preference, session, and browser Accept-Language.
Storageβ
| Item | Store |
|---|---|
| Current visitors | Redis ZSET |
| Today / total unique visitors | Redis HyperLogLog |
| Popular pages | Redis ZSET |
| Live feed | Redis HASH |
| Accumulated snapshots | DB snapshot table |
The Redis live payload does not store raw IP addresses. It stores only the normalized visitor context fields.
Security / Privacyβ
- Beacon POST uses same-origin requests with CSRF.
- Bots are filtered by JS beacon behavior and server-side UA checks.
- Raw IP addresses are not stored for public display.
- Redis keys are isolated with tenant key prefixes.
Demos / Docsβ
View on Plugin Store: store.codebase.how/plugins/site-stats