<?php
// init_tracking.php - One-line tracking initialization

// Function to quickly track any page
function trackThisPage($customName = null) {
    include 'tracking.php';
    
    if ($customName) {
        logVisitor($customName);
    } else {
        // Auto-detect page name
        $page = basename($_SERVER['PHP_SELF']);
        $page = str_replace('.php', '', $page);
        $page = str_replace(['_', '-'], ' ', $page);
        $page = ucwords($page);
        
        if ($page === 'Index') $page = 'Home';
        
        logVisitor($page);
    }
}

// Start tracking
trackThisPage();
?>