2022-06-23 */ require_once(__DIR__.'/ui.php'); // echo a 1x1 transparent gif header('Content-type: image/gif'); echo gzinflate(base64_decode('6wzwc+flkuJiYGDg9fRwCQLSjCDMwQQkJ5QH3wNSbCVBfsEMYJC3jH0ikOLxdHEMqZiTnJCQAOSxMDB+E7cIBcl7uvq5rHNKaAIA')); $eventId = (int)($_GET['event_id'] ?? 0); if (!$eventId) { die; } // try and load event $event = \EventQuery::create()->findOneByEventId($eventId); if (!$event) { die; } // the source of the view should be in the referer (eg the page that embedded the img). // dont track if its missing. $source = $_SERVER['HTTP_REFERER'] ?? ''; if ($source) { // HTTP_CF_CONNECTING_IP will show us the actual client IP (could be ipv6). fallback to REMOTE_ADDR if not set. $ip = $_SERVER['HTTP_CF_CONNECTING_IP'] ?? $_SERVER['REMOTE_ADDR']; $userAgent = $_SERVER['HTTP_USER_AGENT'] ?? null; $event->trackPageView($source, $ip, $userAgent); }