(function() {
    const config = document.currentScript.dataset;
    const apiKey = config.key;
    if (!apiKey) return;

    const data = {
        api_key: apiKey,
        url: window.location.href,
        referrer: document.referrer,
        screen: window.screen.width + 'x' + window.screen.height
    };

    fetch('http://69.5.189.108/api/admin.php?action=track', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(data),
        mode: 'no-cors' // Para evitar problemas de preflight em domínios diferentes
    });
})();
