@extends('admin.layouts.app') @section('title', __('Search Keyword Analytics') . ' — ' . __('The Braj')) @section('page-title', __('Search Keyword Analytics')) @section('content')
🔍

{{ __('Search Keyword Analytics') }}

{{ __('Pilgrim Demand Tracker') }}

{{ __('Track exact search terms devotees are looking for across Braj Dham, spot high-demand items, and discover zero-result opportunities.') }}

{{ __('Total Searches') }}

{{ number_format($totalSearches) }}

{{ ucfirst($period) }} period volume
📈

{{ __('Unique Keywords') }}

{{ number_format($uniqueKeywords) }}

Distinct search queries
🏷️

{{ __('Zero-Result Searches') }}

{{ number_format($zeroResults) }}

Unmet devotee demand
⚠️

{{ __('Successful Searches') }}

{{ number_format($searchesWithResults) }}

Listings found & served
✅

{{ __('Top Searched Keywords & Demand Ranking') }}

{{ __('Most frequent keywords searched by visitors in the selected period.') }}

{{ $topKeywords->total() }} {{ __('Keywords') }}
@if($topKeywords->isEmpty())
🔍

{{ __('No Search Logs Yet for This Period') }}

{{ __('When visitors search for peda, hotels, taxis or ashrams on /directory or /bazar, ranking logs appear here.') }}

@else @foreach($topKeywords as $index => $kw) @endforeach
# {{ __('Search Keyword') }} {{ __('Search Count') }} {{ __('Avg Listings Found') }} {{ __('Last Searched') }}
{{ ($topKeywords->currentPage() - 1) * $topKeywords->perPage() + $index + 1 }} {{ $kw->sample_keyword }} {{ number_format($kw->search_count) }} @if($kw->avg_results > 0) {{ $kw->avg_results }} items @else 0 (Unmet) @endif {{ \Carbon\Carbon::parse($kw->last_searched_at)->diffForHumans() }}
{{ $topKeywords->links() }}
@endif

💡 {{ __('Zero-Result Demand') }}

{{ __('Devotees searched these but no vendor had listed them. Prime onboard opportunities!') }}

@if($zeroResultKeywords->isEmpty())
🎉

{{ __('No Zero-Result Searches!') }}

{{ __('All devotee searches found matching businesses.') }}

@else
@foreach($zeroResultKeywords as $zk)

{{ $zk->sample_keyword }}

{{ \Carbon\Carbon::parse($zk->last_searched_at)->diffForHumans() }}

{{ $zk->zero_count }} {{ __('hits') }}
@endforeach
@endif

{{ __('Live Search Feed (Recent 20 Searches)') }}

{{ __('Recent real-time searches logged on the directory with IP and device footprints.') }}

@if($recentLogs->isEmpty())
{{ __('No recent search activity.') }}
@else @foreach($recentLogs as $log) @endforeach
{{ __('Timestamp') }} {{ __('Keyword') }} {{ __('Location Filter') }} {{ __('Results Found') }} {{ __('Devotee IP') }}
{{ $log->created_at->format('d M, H:i:s') }} {{ $log->keyword }} {{ $log->place?->name ?? 'All Braj' }} {{ $log->results_count }} {{ $log->ip_address ?? '—' }}
@endif
@endsection