htmlspecialchars((string) $s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); // Barra proporcional — comparar números numa coluna é mais lento do que // comparar comprimentos, e a pergunta aqui é sempre "qual é o maior". $bar = function (int $n, int $max) use ($h): string { $pct = $max > 0 ? max(2, (int) round($n / $max * 100)) : 0; return '
'; }; $table = function (string $title, array $rows, callable $label) use ($h, $bar): string { if (!$rows) { return 'Sem dados no período.
| ' . $label($r) . ' | ' . '' . (int) $r['visits'] . ' | ' . '' . $bar((int) $r['visits'], $max) . ' | ' . '
De onde vêm as pessoas, com que dispositivo e de que país.
shared/platform-tools/bin/geo-build-index.php. O resto funciona na mesma.
Ainda não há visitas registadas no período.
| Origem | Visitas | Visitantes | Conversões | Taxa | Última |
|---|---|---|---|---|---|
= $h($r['source']) ?> |
= (int) $r['visits'] ?> | = (int) $r['visitors'] ?> | = (int) $r['conversions'] ?> | = $r['visits'] > 0 ? number_format($r['conversions'] / $r['visits'] * 100, 1) . '%' : '—' ?> | = $h($r['last_seen'] ? substr((string) $r['last_seen'], 0, 16) : '—') ?> |
A origem é a de primeiro toque: quem chega por um QR code, sai e volta pelo Google continua creditado ao QR code. Bots excluídos.
= $h($f['form']) ?> |
= (int) $f['n'] ?> | = $h(substr((string) $f['last_seen'], 0, 16)) ?> |
' . $h($r['label']) . '') ?>' . $h($r['label']) . '') ?>
Nenhum endereço IP é guardado. O ip_hash serve só para aproximar visitantes
únicos e é salgado com um segredo do servidor, por isso não se reverte.