Files
wevads-platform/public/tracking-manager.php
2026-04-07 03:04:16 +02:00

87 lines
5.7 KiB
PHP

<?php
require_once('/opt/wevads/config/credentials.php');
$pdo = get_pdo('adx_system');
$stats = ['opens' => 0, 'clicks' => 0, 'leads' => 0, 'unsubs' => 0];
try { $stats['opens'] = $pdo->query("SELECT COUNT(*) FROM actions.opens")->fetchColumn() ?: 0; } catch(Exception $e) {}
try { $stats['clicks'] = $pdo->query("SELECT COUNT(*) FROM actions.clicks")->fetchColumn() ?: 0; } catch(Exception $e) {}
try { $stats['leads'] = $pdo->query("SELECT COUNT(*) FROM actions.leads")->fetchColumn() ?: 0; } catch(Exception $e) {}
try { $stats['unsubs'] = $pdo->query("SELECT COUNT(*) FROM actions.unsubscribes")->fetchColumn() ?: 0; } catch(Exception $e) {}
?>
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<title>Tracking Manager - Opens, Clicks, Leads</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<style>
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:system-ui;background:#0a0a0f;color:#e2e8f0;min-height:100vh;padding:20px}
h1{color:#f59e0b;margin-bottom:10px}
.back-link{color:#5eead4;text-decoration:none;display:inline-block;margin-bottom:20px}
.process-box{background:#12121a;border-radius:12px;padding:20px;margin-bottom:20px;border:1px solid #333}
.process-title{color:#f59e0b;margin-bottom:15px;font-size:1.1rem}
.process-flow{display:flex;flex-wrap:wrap;gap:15px;align-items:center;justify-content:center}
.process-step{background:#1a1a2e;border:2px solid #333;border-radius:10px;padding:15px;min-width:130px;text-align:center}
.process-step .icon{font-size:1.8rem;margin-bottom:8px}
.process-step .num{width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:0.8rem;font-weight:bold;margin-bottom:5px}
.process-step .title{font-weight:bold;font-size:0.85rem;margin-bottom:5px}
.process-step .desc{font-size:0.7rem;opacity:0.8}
.process-arrow{color:#f59e0b;font-size:1.5rem}
.summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:15px;margin-bottom:25px}
.summary-card{background:#12121a;padding:20px;border-radius:12px;text-align:center}
.summary-card:nth-child(1){border-left:4px solid #3b82f6}
.summary-card:nth-child(2){border-left:4px solid #f59e0b}
.summary-card:nth-child(3){border-left:4px solid #10b981}
.summary-card:nth-child(4){border-left:4px solid #ef4444}
.summary-val{font-size:2rem;font-weight:bold}
.summary-card:nth-child(1) .summary-val{color:#3b82f6}
.summary-card:nth-child(2) .summary-val{color:#f59e0b}
.summary-card:nth-child(3) .summary-val{color:#10b981}
.summary-card:nth-child(4) .summary-val{color:#ef4444}
.summary-lbl{font-size:0.85rem;opacity:0.7}
.info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:15px;margin-top:15px;font-size:0.85rem}
.info-grid div{background:#1a1a2e;padding:12px;border-radius:8px}
.panel{background:#12121a;border-radius:12px;padding:20px;margin-top:20px}
</style>
</head><body>
<a href="/system-flows.php" class="back-link"><i class="fas fa-arrow-left"></i> Retour aux System Flows</a>
<div class="process-box">
<h3 class="process-title"><i class="fas fa-chart-line"></i> Comment fonctionne le Tracking ?</h3>
<div class="process-flow">
<div class="process-step"><div class="icon">👁️</div><div class="num" style="background:#3b82f6;color:white">1</div><div class="title" style="color:#3b82f6">OPEN</div><div class="desc">Pixel 1x1<br>image tracking</div></div>
<div class="process-arrow">→</div>
<div class="process-step"><div class="icon">🖱️</div><div class="num" style="background:#f59e0b;color:black">2</div><div class="title" style="color:#f59e0b">CLICK</div><div class="desc">Redirect link<br>vers offer</div></div>
<div class="process-arrow">→</div>
<div class="process-step"><div class="icon">💰</div><div class="num" style="background:#10b981;color:white">3</div><div class="title" style="color:#10b981">LEAD</div><div class="desc">Conversion<br>postback</div></div>
<div class="process-arrow">→</div>
<div class="process-step"><div class="icon">🚫</div><div class="num" style="background:#ef4444;color:white">4</div><div class="title" style="color:#ef4444">UNSUB</div><div class="desc">Optout link<br>suppression</div></div>
<div class="process-arrow">→</div>
<div class="process-step"><div class="icon">📊</div><div class="num" style="background:#5eead4;color:black">5</div><div class="title" style="color:#5eead4">STATS</div><div class="desc">Dashboard<br>analytics</div></div>
</div>
<div class="info-grid">
<div><strong style="color:#3b82f6">👁️ Opens:</strong> Pixel transparent 1x1 injecté dans HTML, compte les ouvertures</div>
<div><strong style="color:#f59e0b">🖱️ Clicks:</strong> URLs trackées via serveur OVH (151.80.235.110) puis redirect</div>
<div><strong style="color:#10b981">💰 Leads:</strong> Postbacks reçus des affiliate networks après conversion</div>
</div>
</div>
<h1><i class="fas fa-chart-line"></i> Tracking Manager</h1>
<p style="opacity:0.7;margin-bottom:20px">Opens, Clicks, Leads & Unsubscribes</p>
<div class="summary">
<div class="summary-card"><div class="summary-val"><?=$stats['opens']?></div><div class="summary-lbl">👁️ Opens</div></div>
<div class="summary-card"><div class="summary-val"><?=$stats['clicks']?></div><div class="summary-lbl">🖱️ Clicks</div></div>
<div class="summary-card"><div class="summary-val"><?=$stats['leads']?></div><div class="summary-lbl">💰 Leads</div></div>
<div class="summary-card"><div class="summary-val"><?=$stats['unsubs']?></div><div class="summary-lbl">🚫 Unsubs</div></div>
</div>
<div class="panel">
<h4 style="color:#f59e0b;margin-bottom:15px"><i class="fas fa-server"></i> Serveur de Tracking</h4>
<p><strong>IP:</strong> 151.80.235.110 (OVH)</p>
<p><strong>Domains:</strong> Tracking domains configurés pour redirections</p>
</div>
</body></html>