From 5576215fd4c66803df86f5184ce250a04d2e5c93 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Thu, 17 Nov 2022 02:03:37 +0100 Subject: [PATCH] Identifying by ip + user_agent. --- lib/BurguillosInfo/Tracking.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/BurguillosInfo/Tracking.pm b/lib/BurguillosInfo/Tracking.pm index 9e6ad58..68eb2e4 100644 --- a/lib/BurguillosInfo/Tracking.pm +++ b/lib/BurguillosInfo/Tracking.pm @@ -45,20 +45,20 @@ EOF my $data = $dbh->selectrow_hashref(<<'EOF', undef); SELECT ( - SELECT COUNT(DISTINCT remote_address) FROM requests + SELECT COUNT(DISTINCT (remote_address, user_agent)) FROM requests ) as unique_ips, ( - SELECT COUNT(DISTINCT remote_address) + SELECT COUNT(DISTINCT (remote_address, user_agent)) FROM requests where date > NOW() - interval '1 day' ) as unique_ips_last_24_hours, ( - SELECT COUNT(DISTINCT remote_address) + SELECT COUNT(DISTINCT (remote_address, user_agent)) FROM requests where date > NOW() - interval '1 week' ) as unique_ips_last_week, ( - SELECT COUNT(DISTINCT remote_address) + SELECT COUNT(DISTINCT (remote_address, user_agent)) FROM requests where date > NOW() - interval '1 month' ) as unique_ips_last_month;