Files
analytics/resources/views/reports/acquisition/campaigns.blade.php
T

37 lines
2.5 KiB
PHP
Raw Normal View History

2026-03-24 21:12:21 +01:00
<x-report-layout :website="$website" :from="$from" :to="$to" title="Campaigns (UTM)">
<div class="bg-white rounded-xl border border-gray-200">
@if ($campaigns->isEmpty())
<x-empty-state message="No campaign data available. Traffic with UTM parameters will appear here." />
@else
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Source</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Medium</th>
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Campaign</th>
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Sessions</th>
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Bounce Rate</th>
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Avg. Duration</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200">
@foreach ($campaigns as $row)
<tr>
<td class="px-4 py-2.5 text-sm text-gray-900">{{ $row->utm_source }}</td>
<td class="px-4 py-2.5 text-sm text-gray-500">{{ $row->utm_medium ?? '—' }}</td>
<td class="px-4 py-2.5 text-sm text-gray-500">{{ $row->utm_campaign ?? '—' }}</td>
<td class="px-4 py-2.5 text-sm text-gray-900 text-right tabular-nums">{{ number_format($row->sessions) }}</td>
<td class="px-4 py-2.5 text-sm text-gray-900 text-right tabular-nums">{{ $row->sessions > 0 ? round(($row->bounces / $row->sessions) * 100, 1) : 0 }}%</td>
<td class="px-4 py-2.5 text-sm text-gray-900 text-right tabular-nums">{{ gmdate('i:s', (int) round($row->avg_duration)) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
</x-report-layout>