@php $platformMeta = \App\Services\UserDashboardMetrics::PLATFORM_META; $periodTotal = array_sum($series['values']); $periodBest = count($series['values']) ? max($series['values']) : 0; $periodAvg = count($series['values']) ? (int) round($periodTotal / count($series['values'])) : 0; // Real outcome rate when the queue mirror has data; else the KPI estimate. $rate = $success['rate'] ?? $kpis['success_rate']; $running = auth()->user()->automations()->running()->count(); @endphp
{{-- Title row --}}

Analytics

How your publishing performed across platforms and automations.

@foreach ([7 => '7 days', 30 => '30 days', 90 => '90 days'] as $days => $label) @endforeach
{{-- KPI strip --}}
{{ number_format($periodTotal) }}
Published · last {{ $range }} days
{{ $rate !== null ? $rate.'%' : '—' }}
Success rate
{{ number_format($periodBest) }}
Best day · avg {{ number_format($periodAvg) }}
{{ $running }}
Active automations
{{-- Publishing activity --}}

Publishing activity

Posts published per day

@unless ($series['real']) Estimated @endunless
{{-- Platform distribution --}}

Platform distribution

{{ $distribution['mode'] === 'published' ? 'Published posts per platform' : 'Connected accounts per platform' }}

@if ($distribution['total'] > 0)
{{ number_format($distribution['total']) }}
{{ $distribution['mode'] === 'published' ? 'posts' : 'accounts' }}
@foreach ($distribution['items'] as $d)
{{ $d['label'] }} {{ number_format($d['count']) }} {{ $d['pct'] }}%
@endforeach
@else

Distribution appears once accounts are connected and posts publish.

@endif
{{-- Top automations --}}

Top performing automations

View all
@if ($topAutomations->count()) @php($maxPosts = max(1, $topAutomations->max('posts_published')))
@foreach ($topAutomations as $a) @php($src = $platformMeta[$a->source_platform] ?? [ucfirst($a->source_platform), '#64748b', '']) @php($dst = $platformMeta[$a->target_platform] ?? [ucfirst($a->target_platform), '#64748b', ''])
{{ $a->name }}
{{ $src[0] }} {{ $dst[0] }}
{{ number_format($a->posts_published) }}
{{ $a->success_rate === null ? '—' : rtrim(rtrim(number_format($a->success_rate, 2), '0'), '.').'%' }}
@endforeach
@else

Create an automation to see its performance here.

@endif
{{-- Outcomes --}}

Publish outcomes

@if (($success['published'] + $success['failed']) > 0) @php($outTotal = $success['published'] + $success['failed'])
@if ($success['published'])
@endif @if ($success['failed'])
@endif
Published{{ number_format($success['published']) }}
Failed{{ number_format($success['failed']) }}
{{ $success['rate'] }}%
success rate · from synced jobs
@if ($success['failed'] > 0) Review failed jobs @endif @else

Outcomes appear once your desktop app syncs published and failed jobs.

@endif
@script @endscript