@extends('layouts.admin') @section('title', 'Website analytics') @section('crumbs', 'First-party tracking · no third-party cookies · IPs stored only as hashes') @section('actions')@foreach([7 => '7 days', 30 => '30 days', 90 => '90 days', 365 => '12 months'] as $d => $l) $days === $d])>{{ $l }}@endforeach @endsection @section('content') @php($fmt = fn ($s) => intdiv($s, 60).'m '.str_pad($s % 60, 2, '0', STR_PAD_LEFT).'s')

Visitors per day

@php($max = max(1, $series->max('v')))
@foreach($series as $p)
@endforeach
{{ \Carbon\Carbon::parse($series->first()['d'])->format('j M') }}{{ \Carbon\Carbon::parse($series->last()['d'])->format('j M') }}

Where visitors come from

@php($cm = max(1, $channels->max('v')))@foreach($channels as $c)
{{ $c->ch }}
{{ $c->v }}
@endforeach

Enquiries by source

@forelse($leadSources as $s)@empty@endforelse
SourceLeadsWon
{{ $s->s }}{{ $s->n }}{{ $s->won }}
No enquiries in this period.

Top pages

@foreach($pages as $p)@endforeach
PageViewsVisitorsAvg. timeAvg. scroll
{{ $p->path }}{{ $p->views }}{{ $p->visitors }}{{ $fmt((int) $p->t) }}{{ round($p->sd) }}%

Campaigns (UTM)

@forelse($campaigns as $c)@empty@endforelse
Source / mediumCampaignVisitors
{{ $c->utm_source }} / {{ $c->utm_medium }}{{ $c->utm_campaign ?: '—' }}{{ $c->v }}
Tag your ad links with utm_source, utm_medium and utm_campaign to see them here.

Actions on the site

@php($labels = ['cta_header' => 'Header “Start a project”', 'cta_hero' => 'Hero “Start a project”', 'cta_footer' => 'Footer call to action', 'cta_service' => 'Service “Get a quote”', 'cta_band' => 'Bottom band “Start a project”', 'whatsapp_click' => 'WhatsApp clicks', 'call_click' => 'Phone clicks', 'email_click' => 'Email clicks', 'form_start' => 'Started the contact form', 'form_submit' => 'Sent the contact form']) @forelse($events as $name => $n)
{{ $labels[$name] ?? $name }}{{ $n }}
@emptyNo tracked clicks yet.@endforelse

Devices

@php($dm = max(1, $devices->sum()))@foreach($devices as $d => $v)
{{ ucfirst($d) }}
{{ round($v / $dm * 100) }}%
@endforeach

Cities

Needs Cloudflare geo headers
@forelse($cities as $c => $v)
{{ $c }}{{ $v }}
@emptyNo city data yet.@endforelse

Referring sites

@forelse($referrers as $r)
{{ $r->referrer_host }}{{ $r->v }}
@emptyNo referrers yet.@endforelse

Latest visits

@foreach($recent as $v)@endforeach
WhenPageFromDeviceCityTimeVisitor
{{ $v->created_at->diffForHumans() }}{{ $v->path }}{{ $v->utm_source ?: ($v->referrer_host ?: 'Direct') }}{{ ucfirst($v->device) }} · {{ $v->browser }}{{ $v->city ?: '—' }}{{ $fmt($v->duration_seconds) }}{{ $v->is_new_visitor ? 'New' : 'Returning' }}
@endsection