Daily visitor counter
{{ $setting->is_active ? 'Active' : 'Inactive' }}Count each pseudonymous visitor once per day, independently from page-view analytics.
@extends('backend.layouts.app') @section('title', \App\Http\Helpers\MenuHelper::getPageTitle()) @section('content') @include('backend.module._index-reset-button') @php $pageTitle = \App\Http\Helpers\MenuHelper::getPageTitle(); $isVisitors = $activeTab === 'visitors'; $isPageViews = $activeTab === 'pageviews'; $isReport = $activeTab === 'report'; $today = now()->startOfDay(); $periodDateCarbon = \Illuminate\Support\Carbon::parse($periodDate); $rangeSummary = \Illuminate\Support\Carbon::parse($dateFrom)->format('d M Y').' – '.\Illuminate\Support\Carbon::parse($dateTo)->format('d M Y'); $siteSummary = $site !== '' ? ($siteLabels[$site] ?? $site) : 'All sites'; $reportQuery = array_filter([ 'site' => $site, 'report_year' => $report['year'], 'report_month' => $report['month'], ], fn ($value) => $value !== '' && $value !== null); $activeQuickRange = match (true) { $period === 'day' && $periodDateCarbon->isToday() => 'day', $period === 'week' && $periodDateCarbon->betweenIncluded( $today->copy()->startOfWeek(\Illuminate\Support\Carbon::MONDAY), $today->copy()->endOfWeek(\Illuminate\Support\Carbon::SUNDAY) ) => 'week', $period === 'month' && $periodDateCarbon->isSameMonth($today) => 'month', $period === 'year' && $periodDateCarbon->isSameYear($today) => 'year', $period === '' && $dateFrom === $today->copy()->startOfMonth()->toDateString() && $dateTo === $today->toDateString() => 'month', $period === '' && $dateFrom === $today->copy()->subDays(6)->toDateString() => '7', $period === '' && $dateFrom === $today->copy()->subDays(29)->toDateString() => '30', default => '', }; $quickRanges = [ ['key' => 'day', 'label' => 'Today'], ['key' => 'week', 'label' => 'This week'], ['key' => 'month', 'label' => 'This month'], ['key' => 'year', 'label' => 'This year'], ['key' => '7', 'label' => 'Last 7 days'], ['key' => '30', 'label' => 'Last 30 days'], ]; $visitorMetrics = [ ['label' => 'Daily visits', 'value' => $dailyVisitors, 'note' => $setting->is_active ? 'One count per visitor and site each day' : 'Daily visitor counter is paused', 'icon' => 'M16 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2m16 0v-2a4 4 0 0 0-3-3.87M14 3.13a4 4 0 0 1 0 7.75M14 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z', 'color_classes' => 'bg-violet-50 text-violet-600 dark:bg-violet-500/10 dark:text-violet-300'], ['label' => 'Unique visitors', 'value' => $uniqueVisitors, 'note' => $setting->is_active ? 'Distinct visitors in range' : ($setting->is_page_view_active ? 'Based on page-view data' : 'Both counters are paused'), 'icon' => 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm7 9a7 7 0 0 0-14 0', 'color_classes' => 'bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-300'], ]; $pageViewMetrics = [ ['label' => 'Page views', 'value' => $pageViews, 'note' => $setting->is_page_view_active ? 'Deduplicated over 30 minutes' : 'Page-view tracking is paused', 'icon' => 'M3 3v18h18M7 14l4-4 4 4 6-7', 'color_classes' => 'bg-sky-50 text-sky-600 dark:bg-sky-500/10 dark:text-sky-300'], ['label' => 'Pages visited', 'value' => $pageCount, 'note' => $setting->is_page_view_active ? 'Distinct site pages' : 'Page-view tracking is paused', 'icon' => 'M4 4h16v16H4zM8 8h8m-8 4h8m-8 4h5', 'color_classes' => 'bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-300'], ]; $fieldLabelClasses = 'mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-400'; $selectClasses = 'shadow-theme-xs h-11 w-full appearance-none rounded-lg border border-gray-300 bg-transparent py-2.5 pr-10 pl-4 text-sm text-gray-800 transition focus:border-brand-300 focus:ring-3 focus:ring-brand-500/10 focus:outline-hidden dark:border-gray-700 dark:bg-gray-900 dark:text-white/90'; // Date fields follow the Content Article date input styling (custom calendar icon + showPicker). $dateClasses = 'dark:bg-dark-900 shadow-theme-xs focus:border-brand-300 focus:ring-brand-500/10 dark:focus:border-brand-800 h-11 w-full appearance-none rounded-lg border border-gray-300 bg-transparent bg-none py-2.5 pr-11 pl-4 text-sm text-gray-800 placeholder:text-gray-400 transition focus:ring-3 focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:placeholder:text-white/30'; $quickActiveClasses = 'border-violet-300 bg-violet-50 text-violet-700 shadow-theme-xs dark:border-violet-500/40 dark:bg-violet-500/10 dark:text-violet-300'; $quickInactiveClasses = 'border-gray-200 bg-white text-gray-600 hover:border-gray-300 hover:bg-gray-50 dark:border-gray-700 dark:bg-transparent dark:text-gray-300 dark:hover:bg-white/[0.04]'; @endphp
Traffic overview
Understand who visits, what they read, and how traffic changes over time.
Count each pseudonymous visitor once per day, independently from page-view analytics.
Count each visitor-page pair once per 30 minutes and show the most-viewed pages.
Choose a reporting period, then optionally narrow by site or page.
{{ $label }}
{{ number_format($count) }}
{{ $visitPeriodNotes[$label] ?? 'Daily visits' }}
{{ $metric['label'] }}
{{ number_format($metric['value']) }}
{{ $rangeSummary }} · {{ $siteSummary }} · {{ $chartGranularity === 'month' ? 'grouped by month' : 'one bar per day' }}
Try a wider period or a different site. Bars appear here as soon as visitors arrive.
Bars follow the active report filter: one bar per day for a day, week, month or custom range, and one bar per month when the range is longer than a year. Values follow the selected site filter.
Daily visitor tracking is paused. The figures above reflect data that was collected before it was switched off.
{{ $metric['label'] }}
{{ number_format($metric['value']) }}
{{ $rangeSummary }} · {{ $siteSummary }}
Try a wider period or a different site. New visits will appear here automatically.
Long ranges are grouped by month. A visitor is pseudonymous and may be counted again after clearing their browser cookie.
Highest traffic in the selected report range.
Compare the most-viewed pages in this report.
| # | Page | Site | Page views | Unique visitors | Popularity |
|---|---|---|---|---|---|
| {{ str_pad((string) ($index + 1), 2, '0', STR_PAD_LEFT) }} | {{ $page->page_path }} | {{ $siteLabels[$page->site_key] ?? $page->site_key }} | {{ number_format($page->page_views) }} | {{ number_format($page->unique_visitors) }} |
|
Try widening the report range or removing the page filter. Page views appear here once visitors browse your site.
{{ $kpi['label'] }}
@if (! is_null($kpi['delta'])) {{ $kpi['delta'] >= 0 ? '+' : '' }}{{ number_format($kpi['delta'], 1) }}% @endif{{ $kpi['format'] === 'decimal' ? number_format($kpi['value'], 1) : number_format($kpi['value']) }}
{{ $kpi['note'] }}
| Month | Unique visitors | Page views | Share of year | Distribution |
|---|---|---|---|---|
| {{ $row['label'] }} @if ($row['current']) Current @endif | {{ number_format($row['unique_visitors']) }} | {{ number_format($row['page_views']) }} | {{ number_format($row['share'], 1) }}% |
|
| Total | {{ number_format($report['yearlyUnique']) }} | {{ number_format($report['yearPageViews']) }} | 100% |
Yearly unique visitors are de-duplicated across the whole year; monthly figures are de-duplicated within each month.
No page views were recorded in this month.
@else| # | Page | Site | Page views | Unique visitors | Share |
|---|---|---|---|---|---|
| {{ $index + 1 }} | {{ $page->page_path }} | {{ $siteLabels[$page->site_key] ?? $page->site_key }} | {{ number_format($page->page_views) }} | {{ number_format($page->unique_visitors) }} |
|
This table covers the selected calendar month only; "Most visited pages" above follows the dashboard filters.