Edit @if (empty($steps)) @else
{{-- Overall conversion --}} @php $overallRate = $steps[0]['visitors'] > 0 ? round(($steps[count($steps) - 1]['visitors'] / $steps[0]['visitors']) * 100, 1) : 0; @endphp

Entered Funnel

{{ number_format($steps[0]['visitors']) }}

Completed

{{ number_format($steps[count($steps) - 1]['visitors']) }}

Overall Conversion

{{ $overallRate }}%

{{-- Funnel visualization --}}

Step-by-Step Breakdown

@foreach ($steps as $i => $step) @php $maxVisitors = $steps[0]['visitors'] ?: 1; $widthPct = max(($step['visitors'] / $maxVisitors) * 100, 8); @endphp
{{-- Bar --}}
{{ $i + 1 }}
{{ $step['label'] }} {{ number_format($step['visitors']) }}
{{ $step['conversion_pct'] }}%
{{-- Drop-off indicator --}} @if ($i > 0 && $step['drop_off'] > 0)
{{ number_format($step['drop_off']) }} dropped off ({{ $step['drop_off_pct'] }}%)
@endif
@endforeach
{{-- Step details table --}}
@foreach ($steps as $i => $step) @endforeach
Step Type Visitors Drop-off Conversion
{{ $step['label'] }} {{ $step['type'] === 'pageview' ? 'Page' : 'Event' }} {{ number_format($step['visitors']) }} {{ $i > 0 ? number_format($step['drop_off']) . ' (' . $step['drop_off_pct'] . '%)' : '—' }} {{ $step['conversion_pct'] }}%
@endif