{% extends "base.html" %} {% block title %}{% trans %}QR Analytics{% endtrans %} — {{ qr.label or ('QR #' ~ qr.id) }}{% endblock %} {% block content %}

{% trans %}Scan Analytics{% endtrans %}

{{ qr.label or ('QR #' ~ qr.id) }}

{% trans %}Back to My QR Codes{% endtrans %} {% if csv_allowed %} {% trans %}Export CSV{% endtrans %} {% else %} {% trans %}Export CSV{% endtrans %} {% trans %}Upgrade{% endtrans %} {% endif %}

{% trans %}Total Scans{% endtrans %}

{{ total_scans or qr.scan_count or 0 }}

{% trans %}Unique Scans{% endtrans %}

{{ unique_scans or 0 }}

{% trans %}Type{% endtrans %}

{{ qr.qr_type }}

{% trans %}Created{% endtrans %}

{{ qr.created_at[:10] if qr.created_at else '—' }}

{% if scans %}

{% trans %}Scans Over Time{% endtrans %}

{% endif %} {% if device_breakdown %}

{% trans %}Device Breakdown{% endtrans %}

{% for d in device_breakdown %}
{% if d.device_type == 'mobile' %} {% elif d.device_type == 'tablet' %} {% else %} {% endif %} {{ d.device_type }} {{ d.cnt }}
{% endfor %}
{% endif %} {% if gps_allowed and country_breakdown %}

{% trans %}Country Breakdown{% endtrans %}

{% for c in country_breakdown %}
{{ c.country or 'Unknown' }} {{ c.cnt }}
{% endfor %}
{% elif not gps_allowed %}

{% trans %}Country / GPS Analytics{% endtrans %}

{% trans %}Upgrade your plan to see country-level and GPS location analytics{% endtrans %}

{% endif %}

{% trans %}Scan Log{% endtrans %}

{% if recent %} {{ recent | length }} {% trans %}entries{% endtrans %} {% endif %}
{% if recent %}
{% for scan in recent %} {% endfor %}
{% trans %}Date / Time{% endtrans %} {% trans %}Device{% endtrans %} {% trans %}Browser{% endtrans %} {% trans %}OS{% endtrans %} {% trans %}Country{% endtrans %} {% trans %}GPS Location{% endtrans %} {% trans %}Referrer{% endtrans %}
{{ scan.scanned_at[:16] if scan.scanned_at else '—' }} {% if scan.is_unique %} NEW {% endif %} {% if scan.device_type == 'mobile' %} {% elif scan.device_type == 'tablet' %} {% else %} {% endif %} {{ scan.device_type or '—' }} {% set br = scan.browser or '' %} {% if 'Chrome' in br %} {% elif 'Firefox' in br %} {% elif 'Safari' in br %} {% elif 'Edge' in br %} {% else %}{% endif %} {{ br or '—' }} {% set os = scan.os_name or '' %} {% if 'iOS' in os or 'macOS' in os %} {% elif 'Android' in os %} {% elif 'Windows' in os %} {% elif 'Linux' in os or 'ChromeOS' in os %} {% else %}{% endif %} {{ os or '—' }} {{ scan.country or '—' }} {% if scan.latitude and scan.longitude %} {{ "%.5f"|format(scan.latitude) }}, {{ "%.5f"|format(scan.longitude) }} {% else %} {% endif %} {{ scan.referer or '—' }}
{% else %}

{% trans %}No scans recorded in the selected period{% endtrans %}

{% endif %}
{% endblock %} {% block page_scripts %} {% if scans %} {% endif %} {% endblock %}