{% extends 'layout.html.twig' %} {% block title %}Visitor Analytics{% endblock %} {% block body %}

Page Visit Analytics

Total Visits

  • Last 24 hours: {{ last24hCount }}
  • Last 7 days: {{ last7dCount }}
  • All time: {{ totalVisits }}

Unique Visitors

  • Last 24 hours: {{ uniqueVisitors24h }}
  • Last 7 days: {{ uniqueVisitors7d }}
  • All time: {{ totalUniqueVisitors }}

Tracked by session ID (includes both anonymous and logged-in visitors)

Engagement

  • Avg. Visits/Session: {{ avgVisitsPerSession }}
  • Bounce Rate: {{ bounceRate }}%

Unique Visitors Per Day (Last 7 Days)

{% for stat in uniqueVisitorsPerDay %} {% endfor %}
Date Unique Visitors
{{ stat.day }} {{ stat.count }}

Visits Per Day (Last 30 Days)

{% if visitsPerDay|length > 0 %}
{% for stat in visitsPerDay %} {% endfor %}
Date Visits
{{ stat.day|date('Y-m-d') }} {{ stat.count }}
{% else %}

No visit data for the last 30 days.

{% endif %}

Most Popular Routes (All Time)

{% if mostPopularRoutes|length > 0 %} {% for stat in mostPopularRoutes %} {% endfor %}
Route Visits
{{ stat.route }} {{ stat.count }}
{% else %}

No route data available.

{% endif %}

Recent Visits

{% if recentVisits|length > 0 %} {% for visit in recentVisits %} {% endfor %}
Route Session ID Visited At
{{ visit.route }} {{ visit.sessionId|slice(0, 12) }}... {{ visit.visitedAt|date('Y-m-d H:i') }}
{% else %}

No recent visits recorded.

{% endif %}

Visit Count by Route (Last 7 Days)

{% set filteredVisitStats = visitStats|filter(stat => stat.count >= 5) %} {% if filteredVisitStats|length > 0 %} {% for stat in filteredVisitStats %} {% endfor %}
Route #
{{ stat.route }} {{ stat.count }}
{% else %}

No routes with 5 or more visits recorded in the last 7 days.

{% endif %}

Visitor Sessions (Last 7 Days)

{% if sessionStats|length > 0 %} {% for stat in sessionStats %} {% if stat.visitCount > 1 %} {% endif %} {% endfor %}
Session ID Visits First Visit Last Visit
{{ stat.sessionId|slice(0, 12) }}... {{ stat.visitCount }} {{ stat.firstVisit|date('M d, H:i') }} {{ stat.lastVisit|date('M d, H:i') }}
{% else %}

No visitor sessions recorded in the last 7 days.

{% endif %}

Visit tracking is automated via event listener. Session IDs track all unique visitors (both anonymous and logged-in) for accurate engagement analytics.

{% endblock %}