{{-- Summary Cards --}}
@php
$totalCompletions = $goals->sum('completions');
$totalValue = $goals->sum('total_value');
$overallRate = $totalSessions > 0 ? round(($totalCompletions / $totalSessions) * 100, 2) : 0;
@endphp
Total Completions
{{ number_format($totalCompletions) }}
Overall Conversion Rate
{{ $overallRate }}%
Total Goal Value
${{ number_format($totalValue, 2) }}
{{-- Completions Chart --}}
Goal Completions Over Time
{{-- Per-Goal Table --}}
@if ($goals->isEmpty())
Create one
@else
@php
$typeLabels = [
'url_destination' => 'URL Destination',
'event_match' => 'Event Match',
'duration' => 'Duration',
'pages_per_session' => 'Pages / Session',
];
@endphp
| Goal |
Type |
Completions |
Conversion Rate |
Value |
Status |
@foreach ($goals as $goal)
| {{ $goal->name }} |
{{ $typeLabels[$goal->type] ?? $goal->type }} |
{{ number_format($goal->completions) }} |
{{ $goal->conversion_rate }}% |
{{ $goal->total_value ? '$' . number_format($goal->total_value, 2) : '—' }} |
{{ $goal->is_active ? 'Active' : 'Inactive' }}
|
@endforeach
@endif