setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { die("Connection Error: " . $e->getMessage()); } # Fetch global tracking statistics $stats = ['opens' => 0, 'clicks' => 0, 'leads' => 0, 'unsubscribes' => 0, 'optouts' => 0, 'total' => 0]; $tables = ['opens', 'clicks', 'leads', 'unsubscribes', 'optouts']; foreach($tables as $table) { try { $stmt = $pdo->query("SELECT COUNT(*) as count FROM actions.$table"); $row = $stmt->fetch(PDO::FETCH_ASSOC); $stats[$table] = intval($row['count']); $stats['total'] += $stats[$table]; } catch(Exception $e) { $stats[$table] = 0; } } # Get recent actions from all apps $recent_actions = []; try { $stmt = $pdo->query("SELECT 'OPEN' as type, created_at, process_id, client_id FROM actions.opens ORDER BY created_at DESC LIMIT 100"); $recent_actions = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch(Exception $e) { $recent_actions = []; } ?> 📊 GLOBAL Tracking Dashboard

📊 GLOBAL Tracking Dashboard

Consolidated metrics from all tracking servers | Auto-refresh: 30s | Last update:

📊 Total Events
📧 Opens
🔗 Clicks
⭐ Leads
📵 Unsub
❌ Optout

🔗 Application Dashboards

📋 Recent Activity (Last 100)

0): ?>
P: C:
No recent activity
⟳ This page automatically refreshes every 30 seconds